funkey Posted August 24, 2010 Share Posted August 24, 2010 (edited) expandcollapse popup; #STRUCTURE# =================================================================================================================== ; Name...........: $tagHELPINFO ; Description ...: Contains information about an item for which context-sensitive Help has been requested ; Fields ........: Size - The structure size, in bytes ; ContextType - The type of context for which Help is requested. This member can be one of the following values: ; HELPINFO_WINDOW = 1: Help requested for a control or window. ; HELPINFO_MENUITEM = 2: Help requested for a menu item. ; CtrlID - The identifier of the window or control if ContextType is HELPINFO_WINDOW, ; or identifier of the menu item if ContextType is HELPINFO_MENUITEM ; ItemHandle - The identifier of the child window or control if ContextType is HELPINFO_WINDOW, ; or identifier of the associated menu if ContextType is HELPINFO_MENUITEM. ; ContextID - The help context identifier of the window or control. ; PointX - X position that of the mouse at the time the event occurred ; PointY - Y position that of the mouse at the time the event occurred ; Author ........: funkey ; Remarks .......: ; =============================================================================================================================== Global Const $tagHELPINFO = "uint Size;int ContextType;int CtrlID;handle ItemHandle;dword ContextID;int PointX;int PointY" Global Const $MB_HELP = 0x4000 Opt("GUIOnEventMode", 1) Global $Toggle = False #Region Help GUI Global $hGuiHelp = GUICreate("Help-GUI", 220, 100, -1, -1, 0x80880000, 0x00000088) GUISetBkColor(0xFFFFE1) ;tooltip color GUICtrlCreateLabel("Help for abort button", 10, 10) GUICtrlCreateLabel("Help for retry button", 10, 30) GUICtrlCreateLabel("Help for ignore button", 10, 50) #EndRegion Help GUI Global $hGui = GUICreate("Main Application") GUISetOnEvent(-3, "_Exit") GUIRegisterMsg(0x0053, "_Help") ;WM_HELP Global $Button = GUICtrlCreateButton("Show MsgBox", 50, 50) GUICtrlSetOnEvent(-1, "_Show_MsgBox") GUISetState() While 1 Sleep(20000) WEnd Func _Help($hWnd, $Msg, $wParam, $lParam) Local $tInfo, $ContextType, $CtrlID, $ItemHandle, $ContextID, $X, $Y $tInfo = DllStructCreate($tagHELPINFO, $lParam) $ContextType = DllStructGetData($tInfo, "ContextType") $CtrlID = DllStructGetData($tInfo, "CtrlID") $ItemHandle = HWnd(DllStructGetData($tInfo, "ItemHandle")) $ContextID = DllStructGetData($tInfo, "ContextID") $X = DllStructGetData($tInfo, "PointX") $Y = DllStructGetData($tInfo, "PointY") ConsoleWrite("ContextType: " & $ContextType & @CR) ConsoleWrite("CtrlID: " & $CtrlID & @CR) ConsoleWrite("ItemHandle: " & $ItemHandle & @CR) ConsoleWrite("ContextID: " & $ContextID & @CR) ConsoleWrite("PointX: " & $X & @CR) ConsoleWrite("PointY: " & $Y & @CR & @CR) Local $aPos = ControlGetPos($ItemHandle, "", $CtrlID) $Toggle = Not $Toggle If $Toggle Then _ClientToScreen($ItemHandle, $aPos[0], $aPos[1]) WinMove($hGuiHelp, "", $aPos[0], $aPos[1] + $aPos[3]) GUISetState(@SW_SHOW, $hGuiHelp) Switch StringRight(@OSLang, 2) Case "07" ;german ControlSetText($ItemHandle, "", $CtrlID, "Schließe Hilfe") Case "09" ;english ControlSetText($ItemHandle, "", $CtrlID, "Close Help") EndSwitch Else GUISetState(@SW_HIDE, $hGuiHelp) Switch StringRight(@OSLang, 2) Case "07" ;german ControlSetText($ItemHandle, "", $CtrlID, "Hilfe") Case "09" ;english ControlSetText($ItemHandle, "", $CtrlID, "Help") EndSwitch EndIf EndFunc Func _Show_MsgBox() Local $ret = MsgBox($MB_HELP + 2 + 48, "Hello","What do you want to do?", 0, $hGui) ConsoleWrite($ret & @cr) GUISetState(@SW_HIDE, $hGuiHelp) $Toggle = False EndFunc ; Convert the client (GUI) coordinates to screen (desktop) coordinates Func _ClientToScreen($hWnd, ByRef $x, ByRef $y) Local $stPoint = DllStructCreate("int;int") DllStructSetData($stPoint, 1, $x) DllStructSetData($stPoint, 2, $y) DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint)) $x = DllStructGetData($stPoint, 1) $y = DllStructGetData($stPoint, 2) ; release Struct not really needed as it is a local $stPoint = 0 EndFunc ;==>_ClientToScreen Func _Exit() Exit EndFunc I hope someone can need this. Edited August 26, 2010 by funkey argumentum and pixelsearch 2 Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
TinyHacker Posted August 24, 2010 Share Posted August 24, 2010 THANK YOU Link to comment Share on other sites More sharing options...
Ascend4nt Posted August 24, 2010 Share Posted August 24, 2010 Very nice. I didn't even know Help was available in MessageBoxes My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
TinyH4cker Posted August 25, 2010 Share Posted August 25, 2010 Thanks ... it helped! Link to comment Share on other sites More sharing options...
wakillon Posted August 26, 2010 Share Posted August 26, 2010 Can be usefull but GUICtrlSetTip can give help and is more simple to use Thanks AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
funkey Posted August 26, 2010 Author Share Posted August 26, 2010 Can be usefull but GUICtrlSetTip can give help and is more simple to use But you can not use GUICtrlSetTip for MsgBox. Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
wakillon Posted August 26, 2010 Share Posted August 26, 2010 But you can not use GUICtrlSetTip for MsgBox.Yes, you are right, but in this case your msgbox is based on a gui ! And your strange avatar gives me a headache ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now