
BlueSkyMemory
Active Members-
Posts
27 -
Joined
Everything posted by BlueSkyMemory
-
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])
-
Need help in FindFirstVolumeMountPoint
BlueSkyMemory replied to BlueSkyMemory's topic in AutoIt General Help and Support
I've found another function -- GetVolumePathNamesForVolumeName and it can detect the drive letter. Thank you!😊 -
Slow response to hover messages?
BlueSkyMemory replied to BlueSkyMemory's topic in AutoIt GUI Help and Support
By using SetWindowSubclass, this problem is solved. Thanks to everyone!😊 -
Simple and Stupid Control Hover UDF
BlueSkyMemory replied to binhnx's topic in AutoIt Example Scripts
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!😊 -
How to show a hidden partition? - (Moved)
BlueSkyMemory replied to BlueSkyMemory's topic in AutoIt General Help and Support
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 -
How to show a hidden partition? - (Moved)
BlueSkyMemory replied to BlueSkyMemory's topic in AutoIt General Help and Support
Sorry that I don't know the rules clearly. I've got it! -
How to show a hidden partition? - (Moved)
BlueSkyMemory replied to BlueSkyMemory's topic in AutoIt General Help and Support
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.) -
Slow response to hover messages?
BlueSkyMemory replied to BlueSkyMemory's topic in AutoIt GUI Help and Support
Thanks, I will study it. -
Slow response to hover messages?
BlueSkyMemory replied to BlueSkyMemory's topic in AutoIt GUI Help and Support
Compared to other softwares, the speed to change color seems to be a little slow...(I'm a completist lol) -
Slow response to hover messages?
BlueSkyMemory replied to BlueSkyMemory's topic in AutoIt GUI Help and Support
Yes, and other events. -
#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?
-
$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?
-
How to show a hidden partition? - (Moved)
BlueSkyMemory replied to BlueSkyMemory's topic in AutoIt General Help and Support
I've got it! And do you know how to show a hidden partition? I mean, to give a letter to it. -
How to show a hidden partition? - (Moved)
BlueSkyMemory replied to BlueSkyMemory's topic in AutoIt General Help and Support
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) -
How to show a hidden partition? - (Moved)
BlueSkyMemory replied to BlueSkyMemory's topic in AutoIt General Help and Support
Thank you! I've saved it in my disk lol. But it still depends on so many modules. And it cannot detect hidden partitions. -
How to show a hidden partition? - (Moved)
BlueSkyMemory replied to BlueSkyMemory's topic in AutoIt General Help and Support
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. -
How to show a hidden partition? - (Moved)
BlueSkyMemory replied to BlueSkyMemory's topic in AutoIt General Help and Support
Thanks, it works fine! But it's a pity that it doesn't support GPT disk.