Jump to content

zaetep

Members
  • Posts

    11
  • Joined

  • Last visited

zaetep's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. au3userabbrev.properties contains: # AutoIt3 User properties crl=& @crlf & Gets to crl, goes red and then won't let me press space. au3abbrev.properties contains:
  2. Hi, I just discovered the abbreviation manager. I put my abbreviation (crlf to expand to & @crlf &) in as described and it all looks ok. When i type the abbreviation in code it turns red but then the space bar does nothing (not even put a space in). It works fine for the built in ones. What have i done wrong? i have tryed it with other abbreviations and expansions but it still doesn't work. zetaep
  3. Sorry about the format in the previous post Ok i think i have found the problem. Apparently the event function has to complete before another event can be registered. I can fix this by having the event just set flags that are picked up in the main loop but it is making things a bit slow. Is there a way to clear the event so another one can take place before the function ends? Any suggestions would be greatly appreciated.
  4. Hi, I'm totally stumped by this one. I have a general purpose input function that allows a user to select one of a group of radio buttons. As soon as a radio is clicked the gui deletes and returns the text of the choice to the calling function. It works really nicely but i have two functions that call it and the event function for selecting a button never runs, it just gets stuck in the loop waiting for a response. It still works in all other cases (in the same execution of the program). And cutting and pasting (to check for typos etc) the call and the function to a test file (not connected to the rest of the code) it works. Is there anything that can stop an event function being called? the function is: ~ ;takes possible choices separated by | in a string, returns the chosen answer or "input cancelled" if closed Func RadioQBox($title, $prompt, $choices) Local $c = StringSplit($choices, "|");make array into string Local $rads[$c[0] + 1] = [$c[0]];array for control ids Local $ypos = 50, $msg, $sel;set y postion Local $hgt = ($c[0] * 40) + 100;set height GUISetState(@SW_DISABLE, $siteGui);disable main gui Local $radGui = GUICreate($title, 500, $hgt, -1, -1, BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU), $WS_EX_TOPMOST);build form GUICtrlCreateGroup($prompt, 50, 10, 400, $hgt - 10) For $i = 1 To $c[0];create radios $rads[$i] = GUICtrlCreateRadio($c[$i], 60, $ypos, 380, 15) GUICtrlSetOnEvent($rads[$i], "RadioChoice");set on event function $ypos = $ypos + 40 Next GUISetState(@SW_SHOW) Global $RadChoice = 0;selected flag While Not $RadChoice Sleep(200) ;db("rboxloop") WEnd ;db("Radiochoice answer") For $i = 1 To $c[0] If $RadChoice = $rads[$i] Then $sel = $c[$i] $RadChoice = 0 GUIDelete($radGui) If $sel = 'other' Then db("Radiochoice other") $sel = InputBox($title, $prompt & @CRLF & "It is recommended that you make your answer roughly the same length and format as the other options") EndIf EndIf Next GUISetState(@SW_ENABLE, $siteGui) Return $sel EndFunc ;==>RadioQBox The event is Func RadioChoice() $RadChoice = @GUI_CtrlId ;db("radiochoice event", @GUI_CtrlId, @GUI_WinHandle, @GUI_CtrlHandle) EndFunc ;==>RadioChoice Hope you can help
  5. THANKYOU Monoscout!!!!!!!!!! Got it working Local $w = WinGetHandle("MC", "") Local $b = ControlGetHandle("MC", "", "[CLASSNN:ToolbarWindow321]") Local $cid = _GUICtrlToolbar_IndexToCommand($b, 4) Local $wParam = _WinAPI_MakeLong($cid, $BN_CLICKED) $message = _WinAPI_PostMessage($w, $WM_COMMAND, $wParam, $ (Thanks to everyone else who had a go too)
  6. Is there a way of sending keystrokes while the machine is locked?
  7. Once again just makes the button look like its pressed without actually activating it (although it seems to work when the PC is locked) I have been trying to find something that can use: _GUICtrlToolbar_SetCmdID($b,4, $cd) and then use the identifier to operate the button directly (the way _GUICtrlButton_Click($cd) works)
  8. I've tried that but it doesn't seem to actually activate the control (even when not locked), i also tried pressing and releasing the button but it does nothing. _GUICtrlToolbar_PressButton($b, "Channel") Sleep(1000) _GUICtrlToolbar_PressButton($b, "Channel", False) _GUICtrlToolbar_ClickButton($b,"Channel") works but only when the window is active
  9. Thanks, however send commands don't seem to work while the PC is locked, no keyboard or mouse functions are available as there are no active windows.
  10. Windows XP Professional Service Pack 3 32-bit Version 2002
  11. Hi, I am writing a script to run a software package overnight. The PC needs to be locked during this time ([windows key] + L). The program presses various GUI controls on the 3rd party software in a certain order. There is one toolbar button i need to press (as well as several buttons and menus which are no problem) I am able to click buttons when it is locked using _GUICtrlButton_Click() as controlClick() won't work, but the toolbar version of this function _GUICtrlToolbar_ClickButton() needs to use the mouse pointer and so doesn't work when the computer is locked or the window isn't the active window. Any help would be greatly appreciated
×
×
  • Create New...