Jump to content

How to convert this autohotkey dllcall to autoit dllcall?


Recommended Posts

Hi, can someone help me convert this autohotkey dllcall to autoit dllcall? Thanks in advance.

; WTNCA_NODRAWICON := 2
; WTNCA_NOSYSMENU := 4
DllCall("uxtheme\SetWindowThemeAttribute", "ptr", WinExist(A), "int", 1, "int64*", 6 | 6<<32, "uint", 8)

 

Edited by kosamja
Link to comment
Share on other sites

Hello.

 

DllCall("UxTheme.dll","LONG","HWND",$YourHWND,"INT",$YourWINDOWTHEMEATTRIBUTETYPE,"ptr",$yourpvAttribute,"dword",$yourcbAttribute)

Saludos

Link to comment
Share on other sites

Hi, thanks for answering but that doesnt remove titlebar icon like it does in autohotkey. Any other way for removing icon in titlebar of any window without also removing taskbar icon? Or could you tell me what are exact values for $YourWINDOWTHEMEATTRIBUTETYPE, $yourpvAttribute and $yourcbAttribute?

Edited by kosamja
Link to comment
Share on other sites

Link to comment
Share on other sites

  • 3 months later...
On 4/23/2016 at 10:27 PM, kosamja said:
; WTNCA_NODRAWICON := 2
; WTNCA_NOSYSMENU := 4
DllCall("uxtheme\SetWindowThemeAttribute", "ptr", WinExist(A), "int", 1, "int64*", 6 | 6<<32, "uint", 8)

 

Still waiting for answer... Could anyone convert this dllcall to autoit so it will work when run. This is not answer:

On 4/27/2016 at 6:07 PM, JohnOne said:
DllCall("UxTheme.dll","LONG", "SetWindowThemeAttribute", "HWND",$YourHWND,"INT",$YourWINDOWTHEMEATTRIBUTETYPE,"ptr",$yourpvAttribute,"dword",$yourcbAttribute)

 

 

Link to comment
Share on other sites

Probably you want this.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;~ typedef struct WTA_OPTIONS {
;~   DWORD dwFlags;
;~   DWORD dwMask;
;~ } WTA_OPTIONS, *PWTA_OPTIONS;

Global Const $WTNCA_NODRAWICON = 0x00000002
Global Const $WTNCA_NOSYSMENU = 0x00000004
Global Const $sTagWTA_OPTIONS = "dword dwFlags;dword dwMask;"
#Region ### START Koda GUI section ### Form=
Global $hGUI = GUICreate("GUI without Icon!!!", 316, 233, 192, 124)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Local $tWTA_OPTIONS = DllStructCreate($sTagWTA_OPTIONS)
DllStructSetData($tWTA_OPTIONS, "dwFlags", BitOR($WTNCA_NODRAWICON, $WTNCA_NOSYSMENU))
DllStructSetData($tWTA_OPTIONS, "dwMask", BitOR($WTNCA_NODRAWICON, $WTNCA_NOSYSMENU))

DllCall("UxTheme.dll", "LONG", "SetWindowThemeAttribute", "HWND", $hGUI, "INT", 1, "ptr", DllStructGetPtr($tWTA_OPTIONS), "dword", DllStructGetSize($tWTA_OPTIONS))
ConsoleWrite(@error & @CRLF)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Saludos

Link to comment
Share on other sites

  • Developers
2 hours ago, kosamja said:

Still waiting for answer... Could anyone convert this dllcall to autoit so it will work when run. This is not answer

It actually is answer and don't see too much wrong with it.
Maybe you need to show who you implemented it in your script!

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

On 8/5/2016 at 3:56 PM, Danyfirex said:

Probably you want this.

Saludos

Yes, thank you very much Danyfirex

On 8/5/2016 at 4:28 PM, Jos said:

It actually is answer and don't see too much wrong with it.
Maybe you need to show who you implemented it in your script!

Jos

I didnt implemented it in any way because I wasnt able to find any similar example on forum like example that Danyfirex written.

; www.autoitscript.com/forum/topic/160944-how-to-check-if-gui-window-is-behind-other-window/
; www.autoitscript.com/forum/topic/93315-detect-window-creation-using-callback-hook/
; www.autoitscript.com/forum/topic/114628-capture-the-windows-events/
; www.autoitscript.com/forum/topic/56536-easy-shell-hooking-example/?page=2
; www.autoitscript.com/forum/topic/164207-capture-event-from-external-windows/
; www.autoitscript.com/forum/topic/150274-how-can-i-detect-clicks-in-injected-system-menu/
; www.autoitscript.com/forum/topic/182083-how-to-convert-this-autohotkey-dllcall-to-autoit-dllcall/
; www.autoitscript.com/forum/topic/77905-sleep-down-to-100-nano-seconds/

#NoTrayIcon
#include<WinAPI.au3>
#include<WinAPISys.au3>

Opt("WinWaitDelay", 0)
Opt("MouseClickDelay", 0)
Opt("MouseClickDownDelay", 0)
Opt("MouseClickDragDelay", 0)
Opt("SendKeyDelay", 0)
Opt("SendKeyDownDelay", 0)
Opt("WinTitleMatchMode", 3)

Global Const $WS_POPUP = 0x80000000
Global Const $WTNCA_NODRAWCAPTION = 0x00000001
Global Const $WTNCA_NODRAWICON = 0x00000002
Global Const $WTNCA_NOSYSMENU = 0x00000004
Global Const $sTagWTA_OPTIONS = "dword dwFlags;dword dwMask;"
Local $tWTA_OPTIONS = DllStructCreate($sTagWTA_OPTIONS)
DllStructSetData($tWTA_OPTIONS, "dwFlags", BitOR($WTNCA_NODRAWCAPTION, $WTNCA_NODRAWICON, $WTNCA_NOSYSMENU))
DllStructSetData($tWTA_OPTIONS, "dwMask", BitOR($WTNCA_NODRAWCAPTION, $WTNCA_NODRAWICON, $WTNCA_NOSYSMENU))
Global $hGUI = GUICreate("", 0, 0, 0, 0, $WS_POPUP)
GUIRegisterMsg(_WinAPI_RegisterWindowMessage('SHELLHOOK'), 'WM_SHELLHOOK') ; Define a window message and assign to the WM_SHELLHOOK function.
_WinAPI_RegisterShellHookWindow($hGUI) ; Register the shell hook message to our GUI.
$hHookFunc = DllCallbackRegister('_WinEventProc', 'none', 'ptr;uint;hwnd;int;int;uint;uint')
$hWinHook = _WinAPI_SetWinEventHook($EVENT_SYSTEM_FOREGROUND, $EVENT_SYSTEM_DIALOGSTART, DllCallbackGetPtr($hHookFunc))

While 1
   _HighPrecisionSleep(0.1)
WEnd

Func WM_SHELLHOOK($hWnd, $iMsg, $wParam, $lParam)
   If $wParam = $HSHELL_REDRAW or $wParam = $HSHELL_WINDOWCREATED Then DllCall("UxTheme.dll", "LONG", "SetWindowThemeAttribute", "HWND", $lParam, "INT", 1, "ptr", DllStructGetPtr($tWTA_OPTIONS), "dword", DllStructGetSize($tWTA_OPTIONS))
EndFunc   ;==>WM_SHELLHOOK

Func _WinEventProc($hHook, $iEvent, $hWnd, $iObjectID, $iChildID, $iEventThread, $imsEventTime)
   If $iEvent = $EVENT_SYSTEM_FOREGROUND or $iEvent = $EVENT_SYSTEM_DIALOGSTART Then DllCall("UxTheme.dll", "LONG", "SetWindowThemeAttribute", "HWND", $hWnd, "INT", 1, "ptr", DllStructGetPtr($tWTA_OPTIONS), "dword", DllStructGetSize($tWTA_OPTIONS))
EndFunc

Func _HighPrecisionSleep($iMicroSeconds,$hDll=False)
   Local $hStruct, $bLoaded
   If Not $hDll Then
      $hDll=DllOpen("ntdll.dll")
      $bLoaded=True
   EndIf
   $hStruct=DllStructCreate("int64 time;")
   DllStructSetData($hStruct,"time",-1*($iMicroSeconds*10))
   DllCall($hDll,"dword","ZwDelayExecution","int",0,"ptr",DllStructGetPtr($hStruct))
   If $bLoaded Then DllClose($hDll)
EndFunc

 

Edited by kosamja
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...