Jump to content

BlueSkyMemory

Active Members
  • Posts

    27
  • Joined

Everything posted by BlueSkyMemory

  1. Concrete error line: $mReturn[Number($i)] = $mTemp Now it's right!
  2. Sorry for not debugging carefully. This error is because the key type is a string and I forget to compulsively transform it to number. I define the key firsty number but when it gets in another For-Loop it becomes a string. Good Lesson. Good luck for you guys, Thank you!😉
  3. This map is like: $g_mImageIndex[1]['Name'] = 'Windows 7 Pro' $g_mImageIndex[1]['xxx'] = 'xxx' $g_mImageIndex[2]['Name'] = 'Windows 7 Ult' $g_mImageIndex[2]['xxx'] = 'xxx' ..... It is defined as a global variable at the top of code. Normal when firstly written ($g_mImageIndex[4] below): (Col 0: key; Col 1: Value) But when calling the callback msg func, this map ($g_mImageIndex[4]) becomes: Place for writing this map: $g_mImageIndex = ImageX_ReadIndex($Path_ImageX, $sImagePath) ;Returns a second-order map which contains image info. Place for re-reading this map: Func Msg_Rec($iCtrl) Switch $iCtrl Case $Combo_Rec_Index Local $iIndex = ComboBox_GetCurSel($Combo_Rec_Index) + 1 pause($g_mImageIndex[$iIndex])
  4. The problem has solved. You can modify the custom DPI Settings for both programs separately.
  5. Actually I DON'T want to use high DPI in my AU3 app when using high DPI in SciTE.
  6. @Shark007 It looks perfect to translate GUI codes, but what I want to do is just disable high dpi in AU3 app when I turn on high dpi in SciTE(Windows Settings)
  7. @ioa747 I've tried this but it doesn't work. It's interesting that VSCode originally supports High DPI and it also doesn't have an effect on AU3 app. When I use this API, the problem : appear(Not before) in VSCode, also appear in SciTE.
  8. While Scite doesn't support high dpi, I open it in compatibility settings. But it brings another problem:My au3 app automatically enables high dpi, causing gui disorder. I've tried #AutoIt3Wrapper_Res_HiDpi=N but it doesn't work. I'd appreciate it if you could offer some help. Thanks.
  9. I've found another function -- GetVolumePathNamesForVolumeName and it can detect the drive letter. Thank you!😊
  10. By using SetWindowSubclass, this problem is solved. Thanks to everyone!😊
  11. Wow, It's a perfect UDF that can easily instead GUICtrlOnHover lol. I've been finding a way to solve my problem for a long time (I wrote one which uses SetWindowLog but the speed seems to be not very fast. Thank you very much!😊
  12. OK. Now the problem is solved. Thanks to everyone! This is my code below, hoping to help others-- Func _GetVolumeMountPoint($sGUID) $tPathName = DllStructCreate("char[2048]") $aResult = DllCall("Kernel32.dll", 'bool', 'GetVolumePathNamesForVolumeNameA', 'str', $sGUID, 'str', $tPathName, 'dword', DllStructGetSize($tPathName), 'dword', DllStructGetPtr($tPathName)) ;~ _ArrayDisplay($aResult) Return $aResult[2] EndFunc
  13. Sorry that I don't know the rules clearly. I've got it!
  14. OK, I've got these APIs. Now I can use FindFirstVolume and FindNextVolume to get all GUIDs, and then assign letter to them. But when I try to use Find First/Next VolumeMountPoint to find out its letter, I failed (actually it can only get the mountpoint I set to, not the drive letter.)
  15. Compared to other softwares, the speed to change color seems to be a little slow...(I'm a completist lol)
  16. #include-once #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> ; #VARIABLES# =================================================================================================================== ; =============================================================================================================================== Global $mCtrl_Hover[] $mCtrl_Hover['Old'] = '' $mCtrl_Hover['LastDown'] = False ;When mouse is down, record the ctrl to check the up ctrl is the previous one ; #FUNCTION# ==================================================================================================================== ; Name...........: _GUICtrlOnHover_Register ; Description ...: Registers a function to be called when GUI elements been hovered. ; Syntax.........: _GUICtrlOnHover_Register($idCtrl [, $sHover_Func= -1 [, $sLeave_Func=-1 [, $sPrimaryDown_Func=-1 [, $sPrimaryUp_Func=-1]]]]) Func _GUICtrlOnHover_Register($idCtrl, $sHover_Func = -1, $sLeave_Func = -1, $sPrimaryDown_Func = -1, $sPrimaryUp_Func = -1) If $idCtrl = -1 Then $idCtrl = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle(-1)) If $sHover_Func <> -1 Then _NewMap($mCtrl_Hover, $idCtrl, 'Hover', $sHover_Func) If $sLeave_Func <> -1 Then _NewMap($mCtrl_Hover, $idCtrl, 'Leave', $sLeave_Func) If $sPrimaryDown_Func <> -1 Then _NewMap($mCtrl_Hover, $idCtrl, 'PrimaryDown', $sPrimaryDown_Func) If $sPrimaryUp_Func <> -1 Then _NewMap($mCtrl_Hover, $idCtrl, 'PrimaryUp', $sPrimaryUp_Func) _NewMap($mCtrl_Hover, $idCtrl, 'IsHover', False) ;When mouse is hovering the ctrl, do not call Hover Func when the mouse moving on it. If Not MapExists($mCtrl_Hover[$idCtrl], 'IsRegistered') Then Local $hProcNew = DllCallbackRegister("_GUICtrlOnHover__CallBack", "int", "hwnd;uint;uint;dword") $mCtrl_Hover['Old'] = _WinAPI_SetWindowLong(GUICtrlGetHandle($idCtrl), $GWL_WNDPROC, DllCallbackGetPtr($hProcNew)) _NewMap($mCtrl_Hover, $idCtrl, 'IsRegistered', True, False) EndIf EndFunc ;==>_GUICtrlOnHover_Register Func _GUICtrlOnHover__CallBack($hWnd, $uiMsg, $wParam, $lParam) Local $iCtrl = _WinAPI_GetDlgCtrlID($hWnd) Switch $uiMsg Case $WM_LBUTTONDOWN ;PrimaryDown $mCtrl_Hover['LastDown'] = $iCtrl If MapExists($mCtrl_Hover[$iCtrl], 'PrimaryDown') Then Call($mCtrl_Hover[$iCtrl]['PrimaryDown'], $iCtrl) EndIf Case $WM_LBUTTONUP ;PrimaryUp If MapExists($mCtrl_Hover[$iCtrl], 'PrimaryUp') And $iCtrl = $mCtrl_Hover['LastDown'] Then Call($mCtrl_Hover[$iCtrl]['PrimaryUp'], $iCtrl) EndIf $mCtrl_Hover['LastDown'] = False Case $WM_MOUSEHOVER ;Hover If MapExists($mCtrl_Hover[$iCtrl], 'Hover') And Not $mCtrl_Hover[$iCtrl]['IsHover'] Then $mCtrl_Hover[$iCtrl]['IsHover'] = True Call($mCtrl_Hover[$iCtrl]['Hover'], $iCtrl) EndIf Case $WM_MOUSELEAVE ;Leave If MapExists($mCtrl_Hover[$iCtrl], 'Leave') Then $mCtrl_Hover[$iCtrl]['IsHover'] = False Call($mCtrl_Hover[$iCtrl]['Leave'], $iCtrl) EndIf Case $WM_MOUSEMOVE ;Move If Not $mCtrl_Hover[$iCtrl]['IsHover'] Then _GUICtrlOnHover__TrackMouseEvent($hWnd, BitOR($TME_HOVER, $TME_LEAVE), 1) ;Triggers a hover/leave message EndSwitch Return _WinAPI_CallWindowProc($mCtrl_Hover['Old'], $hWnd, $uiMsg, $wParam, $lParam) EndFunc ;==>_GUICtrlOnHover__CallBack Func _GUICtrlOnHover__TrackMouseEvent($hWnd, $iFlags, $iTime) Local $tTME = DllStructCreate('dword;dword;hwnd;dword') DllStructSetData($tTME, 1, DllStructGetSize($tTME)) DllStructSetData($tTME, 2, $iFlags) DllStructSetData($tTME, 3, $hWnd) DllStructSetData($tTME, 4, $iTime) Local $aRet = DllCall('user32.dll', 'bool', 'TrackMouseEvent', 'struct*', $tTME) If @error Then Return SetError(@error, @extended, 0) Return $aRet[0] EndFunc ;==>_GUICtrlOnHover__TrackMouseEvent Only can be run in AutoIt Beta :) I use _WinAPI_SetWindowLong to response to hover messages, but it is too slow. Is there anyone can give some advice?
  17. $RET = DllCall("Kernel32.dll", "int", "FindFirstVolume", "str", "", "str", 255) ConsoleWrite($RET[1] & @TAB & DriveGetLabel($RET[1]) & @TAB & DirGetSize($RET[1]) & @CRLF) ConsoleWrite(_GetVolumeMountPoint($RET[1])) $RET[1] = $RET[0] While 1 $RET = DllCall("Kernel32.dll", "int", "FindNextVolume", "int", $RET[1], "str", "", "str", 255) If Not $RET[0] Then ExitLoop ConsoleWrite(_GetVolumeMountPoint($RET[2])) ConsoleWrite($RET[2] & @TAB & DriveGetLabel($RET[2]) & @CRLF) WEnd Func _GetVolumeMountPoint($sGUID) Local $sResult = '' Local $tTag = DllStructCreate("char lpszVolumeMountPoint[256]") $aRet = DllCall("Kernel32.dll", "int", "FindFirstVolumeMountPoint", "str", $sGUID, "str", $tTag, 'int', DllStructGetSize($tTag)) $sResult &= $aRet[2] Return $sResult $aRet[1] = $aRet[0] While 1 $aRet = DllCall("Kernel32.dll", "int", "FindNextVolumeMountPoint", "int", $aRet[1], "str", $tTag, 'int', DllStructGetSize($tTag)) If Not $aRet[0] Then ExitLoop $sResult &= $aRet[2] WEnd Return $sResult EndFunc ;==>_GetVolumeMountPoint This is my code. The function is to get all GUIDs and then get the mountpoint of them. But the result is that it can only get which mountpoint I set to, not the drive letter. Do I misunderstand it? So why it cannot get the drive letter?
  18. I've got it! And do you know how to show a hidden partition? I mean, to give a letter to it.
  19. I've found your code is so powerful! By the way, could you please help extract the part that determines whether it is an active partition? Thanks a lot! (To ensure which partitions can be booted)
  20. Thank you! I've saved it in my disk lol. But it still depends on so many modules. And it cannot detect hidden partitions.
  21. Yes, I can use Diskpart and StringRegExp to make it work. But for compatibility and smaller size, I want to use API instead of other modules.
  22. Thanks, it works fine! But it's a pity that it doesn't support GPT disk.
×
×
  • Create New...