Jump to content

GuiCtrlCreateCombo


Bert
 Share

Recommended Posts

Here is a fun one:

I wrote a program that will act like a predefined clipboard. You run the main exe, and when you need it, you press ctrl + F11 to run QuickPaste. I have tested it on about 10 PCs. works fine. I conducted my test by running it from my flash drive, and from the root of C:\

This is the problem: I ran it on one PC, and the choices on the dropdown (GuiCtrlCreateCombo) are not there. When you click the dropdown, its like the list doesn't work. Did I do something wrong in the code?

Here is the code for QuickPaste, and what happens before QuickPaste runs:

;============

; UNPlus.exe process the following keystrokes when Ctrl + F11 is pressed:

; HotKeySet ("^{F11}", "test5")

; Func test5()

; Send("^a") ;selects all text in field

; Send("^x") ;blanks out the text field

; Runwait ("quickpaste.exe", "")

; Send("^v") ;paste text from QuickPaste to field

; EndFunc

;============

QuickPaste code:

-----------

#include <GuiConstants.au3>

;-----------------------------

fileopen ("quickpaste.ini", 0)

$note1 = FileReadLine ("quickpaste.ini")

GUICreate("QuickPaste", 300, 75)

$Combo_2 = GuiCtrlCreateCombo("", 20, 20, 200, 21)

GuiCtrlSetData($combo_2, $note1)

$button1 = GuiCtrlCreateButton("Paste", 230, 20, 60, 20)

; Run the GUI until it is closed

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

;When button is pressed, label text is copied to the clipboard

Case $msg = $button1

$data = GUICtrlRead($Combo_2)

ClipPut($data)

exit

EndSelect

WEnd

Exit

;UNPlus.exe will perform the ^v to paste the data to the field desired

Link to comment
Share on other sites

Here is a fun one:

I wrote a program that will act like a predefined clipboard. You run the main exe, and when you need it, you press ctrl + F11 to run QuickPaste. I have tested it on about 10 PCs. works fine. I conducted my test by running it from my flash drive, and from the root of C:\

This is the problem: I ran it on one PC, and the choices on the dropdown (GuiCtrlCreateCombo) are not there. When you click the dropdown, its like the list doesn't work. Did I do something wrong in the code?

Here is the code for QuickPaste, and what happens before QuickPaste runs:

;============

; UNPlus.exe process the following keystrokes when Ctrl + F11 is pressed:

; HotKeySet ("^{F11}", "test5")

; Func test5()

; Send("^a") ;selects all text in field

; Send("^x") ;blanks out the text field

; Runwait ("quickpaste.exe", "")

; Send("^v") ;paste text from QuickPaste to field

; EndFunc

;============

QuickPaste code:

-----------

#include <GuiConstants.au3>

;-----------------------------

fileopen ("quickpaste.ini", 0)

$note1 = FileReadLine ("quickpaste.ini")

GUICreate("QuickPaste", 300, 75)

$Combo_2 = GuiCtrlCreateCombo("", 20, 20, 200, 21)

GuiCtrlSetData($combo_2, $note1)

$button1 = GuiCtrlCreateButton("Paste", 230, 20, 60, 20)

; Run the GUI until it is closed

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

;When button is pressed, label text is copied to the clipboard

Case $msg = $button1

$data = GUICtrlRead($Combo_2)

ClipPut($data)

exit

EndSelect

WEnd

Exit

;UNPlus.exe will perform the ^v to paste the data to the field desired

was your ini file on the computer? also it looks like you're just grabbing one line from the ini to add to the list...
Link to comment
Share on other sites

That fixed it. THANKS!

It pulls only the first line, and that is fine. QuickPaste is for just a few choices, making it fast to paste things in you type all the time. The main program this works with has things that need to be entered that are cap sensitive. Makes thins much easier.

Link to comment
Share on other sites

Yes. There is a combo caveat explained in the helpfile. If you ever find unusuality... the helpfile should be your first visit...

Lar.

Larry

Under caveat are you reffering to:

Under Windows XP/2003 window will adapt the size of the opened combo.

Because I experienced that caveat on XP - combo was kind of disproportional to other controls but it got populated anyway.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...