Jump to content

Splitbutton dropdown menu not showing under Windows PE


Recommended Posts

Hi,

I've created a custom tool for use in a Windows PE enviroment. Because of the number of buttons in use in de UI, I've planned on using the splitbutton in de UI.

When I test the script under Windows, the button works perfectly, but when the button is tested under Windows PE, de button appears correctly (with dropdown arrow), but no dropdown menu is showing when the button is pressed.

Is there a special requirement for this dropdown menu, that is not available under Windows PE? It's a Windows PE 3.1 (Win Vista/7) enviroment, so I think it should work.

Code for the button:

$doPC = _GUICtrlButton_Create($main, "Computer -> ", 255, 285, 90, 25, $BS_SPLITBUTTON) ;==> Create knop

;==> Code from Autoit site
Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam)
    #forceref $hWnd, $Msg, $wParam
    Local Const $BCN_HOTITEMCHANGE = -1249
    Local $tNMBHOTITEM = DllStructCreate("hwnd hWndFrom;int IDFrom;int Code;dword dwFlags", $lParam)
    Local $nNotifyCode = DllStructGetData($tNMBHOTITEM, "Code")
    Local $nID = DllStructGetData($tNMBHOTITEM, "IDFrom")
    Local $hCtrl = DllStructGetData($tNMBHOTITEM, "hWndFrom")
    Local $dwFlags = DllStructGetData($tNMBHOTITEM, "dwFlags")
    Local $sText = ""
    Switch $nNotifyCode
        Case $BCN_DROPDOWN
            _Popup_Menu($hCtrl)
  Case $BN_PUSHED
            _Popup_Menu($hCtrl)
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==> WM_NOTIFY

Func _Popup_Menu($hCtrl)
    Local $hMenu
    Local Enum $idReboot = 1000, $idShutdown, $idInfo
    $hMenu = _GUICtrlMenu_CreatePopup()
    _GUICtrlMenu_InsertMenuItem($hMenu, 0, "Herstarten", $idReboot)
    _GUICtrlMenu_InsertMenuItem($hMenu, 1, "Afsluiten", $idShutdown)
    Switch _GUICtrlMenu_TrackPopupMenu($hMenu, $hCtrl, -1, -1, 1, 1, 2)
        Case $idReboot
;~  Shutdown(6)
   Exit
  Case $idShutdown
;~  Shutdown(13)
   Exit
    EndSwitch
    _GUICtrlMenu_DestroyMenu($hMenu)
EndFunc   ;==> _Popup_Menu
Edited by Maikey81
Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By ute_man
      Hi Forum,
      I am struggling to select an IP address from "Server Interface" dropdown (ComboBox2) of tftpd32 client.
      tftpd32 is a TFTP server - TFTPD32 : an opensource IPv6 ready TFTP server/service for windows : TFTP server (pagesperso-orange.fr)
      The IP addresses (and the associated interfaces) are dynamic in ComboBox2.
      What I want to do is to select an item from ComboBox2 which contains a given IP address (eg. 192.168.2.1) - (which is hidden in the picture as it is at the bottom of the list) and fill the edit field with the selection. (Note : the ComboBox items contain the IP address and the Interface name, therefore IP address is just a part of the item)
      I am not sure whether functions such as _GUICtrlComboBox_SelectString() are only to be used with Autoit generated ComboBoxes.
      Please help !!!!
      My code below, it does not select the ComboBox2 item with my IP address 192.168.2.1.
      Local $hWnd=ControlGetHandle("Tftpd32 by Ph. Jounin", "", 4008) Sleep(100) ControlFocus("Tftpd32 by Ph. Jounin", "", $hWnd) Sleep(100) Local $IP = "192.168.2.1" _GUICtrlComboBox_SelectString($HWnd, $IP) ComboBox2 ID = 4008


    • By anit
      Hi,
      I am trying to select a value from a drop-down (highlighted in the attached image). There is no control ID associated with the window, so I am unable to use the Control* type functions. There are two values starting with 'C' in the drop-down. I tried fetching the drop-down value by passing Send("{custom}") but it always selects the first occurrence of value starting with 'C'.
      Please suggest how may I resolve this.
      Thanks!
       

    • By littleboy62
      Hello.
       
      For a project of a tool, I have to launch a program.
      This one: Display Properties control (run desk.cpl)
      I have to resize it, so we can see what's necessary.

      I'm getting there.
      The problem is that there is a drop-down menu: so I want to disable it.
      How to do this?

      I already did a test with the notepad. By deactivating the "close" button.
      Here is the code:
       
      Run("Notepad.exe") WinWait("[CLASS:Notepad]") $Hwnd = WinGetHandle("[CLASS:Notepad]") $menu = DllCall("user32.dll","hwnd","GetSystemMenu","hwnd", $Hwnd, "int",0) DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", 0xF060, "int", 0x0);SC_CLOSE MsgBox(0,'',1) $menu = DllCall("user32.dll","hwnd","GetSystemMenu","hwnd", $Hwnd, "int",1) DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", 0xF060, "int", 0x0);SC_CLOSE
      I would like to do the same, but with the drop-down menu (with DllCall).
      Is it possible to disable / block (or other) the drop-down menu of a program?

      Thank you for your answers.
      Sincerely,
      Thomas.
    • By UGH
      Autoit team are assbags.    They want to hold out that they are soooo much smarter than everyone else and they really don't want to help anyone with their questions.   In that case then why have a website.   Oh i know, they get their kicks out of laughing at everyone. 
       
       
       
       
       
       
       
    • By zzghost
      Hello,
      I have been reading every tutorial and help document I can find trying to figure out how to capture from a website the content of a dropdown in order to populate it into a GUI with checkboxes to run some code based off of the selections...
      I would like a script to read the options from this form-group and populate a gui. I have all the code written except this part, as of now I have to manually pull this from the site and dump into my code but it changes from time to time so I would like my code to be more flexible...
       
      Hope this makes sense?
×
×
  • Create New...