Jump to content

NewBie_2018

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by NewBie_2018

  1. I have tried this I hope this is what you want #NoTrayIcon Opt('GUIOnEventMode', 1) Global $hGui = GUICreate("Dummy Gui", 0, 0, -200, -200, -1, 0, WinGetHandle(AutoItWinGetTitle())) GUISetState() Global $Context = GUICtrlCreateContextMenu(GUICtrlCreateDummy()) Global $step1 = GUICtrlCreateMenuItem("&step1", $Context) GUICtrlSetOnEvent(-1, '_Hello') GUICtrlCreateMenuItem("", $Context) Global $step2 = GUICtrlCreateMenu("&step2", $Context) Global $step2_1 = GUICtrlCreateMenuItem("&step2_1", $step2) GUICtrlSetOnEvent(-1, '_HowAreYou') GUICtrlCreateMenuItem("", $Context) Global $step3 = GUICtrlCreateMenu("&step3", $Context) Global $step3_1 = GUICtrlCreateMenuItem("&step3_1", $step3) Global $step3_2 = GUICtrlCreateMenuItem("&step3_2", $step3) TrackPopupMenu($hGui, GUICtrlGetHandle($Context), MouseGetPos(0), MouseGetPos(1)) ; Show at the given coordinates (x, y) the popup menu (hMenu) which belongs to a given GUI window (hWnd) Func TrackPopupMenu($hWnd, $hMenu, $x, $y) DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $x, "int", $y, "hwnd", $hWnd, "ptr", 0) EndFunc ;==>TrackPopupMenu Func _Hello() MsgBox(0, "Hello", "Hello") EndFunc Func _HowAreYou() MsgBox(0, "How Are You", "How Are You") EndFunc
  2. @FrancescoDiMuro Sometimes I use that, but that's not satisfactory There are some unnatural sentences, so I have to modify them If I didn't know English at all, I could not even search it
  3. @FrancescoDiMuro Thank you for reply ! My problem is solved ! It was because of my poor searching skill
  4. @JLogan3o13 Thank you so much ! I think the most problem is my poor searching skill I should study English hard too
  5. omg, I'm so sorry for choosing the wrong place In this case, do I have to write one more in GUI Help and Support?
  6. Hello Before start asking question, I apologize for my poor english (So I'm writing this topic using translator ) This is my question Among many volumes in computer, I want to get the letter of volume. So I wrote this code #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("title", 291, 246, 184, 261) GUISetOnEvent($GUI_EVENT_CLOSE, "Exitapp") $Combo1 = GUICtrlCreateCombo("select volume", 16, 32, 257, 25, 0x0003) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button1 = GUICtrlCreateButton("Check", 16, 70, 257, 25) GUICtrlSetOnEvent($Button1, "Func_Check") GUISetState(@SW_SHOW) Local $var = DriveGetDrive("All") If Not @error Then For $i = 1 To $var[0] $DriveType = DriveGetType($var[$i]) If $DriveType = "Removable" Or $DriveType = "Fixed" Then $letter = StringUpper($var[$i]) GUICtrlSetData($Combo1, $letter) EndIf Next EndIf While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ;;;;;;;;;;;;;;;;;;;;;;;;; UDF Area ;;;;;;;;;;;;;;;;;;;;;;;;; Func Func_Check() MsgBox(0, "test", $Combo1) EndFunc Func Exitapp() Exit EndFunc but, When I click the button, I can see only " 3 " According to a lot of topics what i saw, in case using " | ", I can get the value what I want. But I have no idea how to use " | " in my code. If there's a good way I do not know, please let me know. Thank you for reading. Have a good day.
×
×
  • Create New...