Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/18/2012 in all areas

  1. You may need this. http://support.microsoft.com/kb/138813
    1 point
  2. T isn't a specific character. It is a macro for whatever platform you target. W is a "wide character" because originally it was two bytes instead of just one. Unicode is one to four bytes per character depending on what's going on. Interlingual text is probably one of the more difficult programming mechanisms.
    1 point
  3. Yes, try this example: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> _Example() ; _Example Func _Example() GUICreate("My GUI", 640, 480, 50, 50) ; will create a dialog box that when displayed is centered GUIRegisterMsg($WM_MOUSEWHEEL, "_WM_MOUSEWHEEL") GUISetState(@SW_SHOW) ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_PRIMARYDOWN Sleep(250) ToolTip("") WinClose("[CLASS:Notepad]", "") EndSwitch WEnd GUIDelete() EndFunc ;==>_Example Func _WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam) Local $iMPos = MouseGetPos() ToolTip("Mouse wheel is detected!" & @CRLF & @CRLF & 'Click in the "My GUI" to return...', $iMPos[0], $iMPos[1], "Test", 1, 3) Run("Notepad.exe") Return $GUI_RUNDEFMSG EndFunc ;==>_WM_MOUSEWHEEL Regards, João Carlos.
    1 point
  4. Try this: #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> $Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work Global $hForm, $hListView _Main() Func _Main() $hForm = GUICreate("ListView Set Column Width", 400, 300, -1, -1, $WS_OVERLAPPEDWINDOW) $hListView = GUICtrlCreateListView("Column 1|Column 2|Column 3|Column 4", 2, 2, 394, 268) GUIRegisterMsg($WM_SIZING, "_RegisterMsg") GUIRegisterMsg($WM_SIZE, "_RegisterMsg") GUISetState() ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Func _RegisterMsg($hWnd, $Msg, $WParam, $LParam) Local $iColCount, $aGetSize, $iWidth $iColCount = _GUICtrlListView_GetColumnCount($hListView) $aGetSize = WinGetClientSize($hWnd) $iWidth = Int($aGetSize[0] / $iColCount) For $i = 0 To $iColCount _GUICtrlListView_SetColumnWidth($hListView, $i, $iWidth) Next EndFunc Regards, João Carlos.
    1 point
  5. czardas

    Snippet Dump

    Tip Snippet No 2 After getting all mixed up regarding this subject previously in Help and Support and missing the target completely, I came up with a very simple idea to solve the problem of error checking within nested functions once and for all. Without proper access to a compiuter, I didn't get the opportunity to test this out until today. The problem is simple, as is the solution. After exiting a function, any error that has been thrown can not be checked when the function is nested; at least not without some kind of customised error handling. So if you nest UDF functions, it is possible to use a method similar to the one demonstrated below when the fail point can easily determind. Global $g_KickBack_ = 0 ; This is our error count _FuncNestTest() Func _FuncNestTest() Local $ret = "accepted" _CheckError(_CheckError(_CheckError(_CheckError(_CheckError($ret))))) ; Here five UDF functions are nested, could be anything. MsgBox(0, "Hard Error", "Failure occured at nested function number : " & 5 - $g_KickBack_ + 1) ; Function Calls - errors + 1 (base count) EndFunc Func _CheckError($vParam) If $g_KickBack_ > 0 Then $g_KickBack_ += 1 ; Tracking the fail point Return SetError(1, 0, "la di da di da") EndIf ; General error testing ... Can be anything If $vParam <> "accepted" Then $g_KickBack_ += 1 ; Tracking the fail point Return SetError(2, 0, "la di da di da") EndIf ; Invoke failure on the 2nd run - simulated function Return StringTrimLeft($vParam, 1) EndFunc
    1 point
×
×
  • Create New...