
MrKris1224
Active Members-
Posts
130 -
Joined
-
Last visited
Everything posted by MrKris1224
-
Hi, i'am making automation script to another application in my job. The problem is application have many controls with same class name and instance. So i tried to get handle of controls by them position. There is problem because in application there's many controls that have same position (they ar in another tabs). So i included control's size. It works a long time, but now i need get handle of control which have position and size like another control in application window (in another tab). Can anyone have any solution for that? I think ControlGetFocus will be suitable but that returns ClassnameNN. IT is possible get control handle or ID which is actually focused? Controls isn't standard windows controls. Update Maybe it will help. All controls are from Visual Component Library, application is written in Delphi. It is a way to use VCL lib in autoit? Update This control is "TPageControl". By controls loop i got that control have "TTabSheet" controls which are tabs but Autoit Window Info doesn't showing them (bug?) i got handle to "TTabSheet" control but tab doesnt changing if i use ControlClick. Some info about control: TPageControl Any Ideas?
-
GDI+ Clear bitmaps drawed in window
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
Thanks all for help.... Solved... _WinAPI_RedrawWindow($hWin, 0, 0, BitOR($RDW_INVALIDATE, $RDW_ALLCHILDREN)) -
Hi, i'am making small application to my job. I need to draw some icons / bitmaps in another application window. I'am drawing icons by this code: ;(...) $aPos = ControlGetPos($hWin, "", $hCtrl) $hDC = _WinAPI_GetWindowDC($hWin) $hGraphic = _GDIPlus_GraphicsCreateFromHDC($hDC) _GDIPlus_GraphicsClear($hGraphics) _GDIPlus_GraphicsDrawImage($hGraphic, $hIcon, $aPos[0] + $aPos[2] + 5, $aPos[1] + $aPos[3] - 5) _GDIPlus_GraphicsDispose($hGraphic) _WinAPI_ReleaseDC($hWin, $hDC) ;(...) But now i must delete drawed bitmaps from window. I can't handle graphics objects all time because i'am closing and opening another windows of that application but sometimes i must draw icons then draw them again in another places. But there's problem because i can't delete older icons. _Winapi_RedrawWindow doesn't work. There's any method to clear that icons? That's what i drawing for example in this window (info icon):
-
How to rotate image object in GDI+
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
Thanks so much i needed exactly that Topic to close -
How to rotate image object in GDI+
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
Ok, but this rotatining all of images i drawn. I wanna rotate one image -
How to code it using AutoIT?
MrKris1224 replied to oemript's topic in AutoIt General Help and Support
_RunDos() -
How to rotate image object in GDI+
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
_GDIPlus_ImageRotateFlip() have only 4 angles _GdiPlus_MatrixRotate() doesn't work for me (image object) -
Hi, i'am making simple 2D "engine" using gdi+ and now i'am trying to make function that will be able to rotate image before i draw it to buffor. I'am loading images by _GDIPlus_ImageLoadFromFile() then draw them to buffor by _GDIPlus_GraphicsDrawImage() and then copying that buffor to GUI's buffor. The question is how can i rotate image object before i draw it to buffor?
-
Using Wlanapi.dll in autoit
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
I think it's too hard for me :/ can i just write here void or something? i don't need list of peers @edit It's mine code excluding functions from last posts: Global $tag_WLAN_HOSTED_NETWORK_STATUS = "INT HostedNetworkState;int IPDeviceID;byte Mac_Address[6];ptr pMacAddress;ulong ulChannelFrequency;dword dwNumberOfPeers;byte nothing[1]" Global $hDll_Wlanapi = DllOpen("Wlanapi.dll") Global $hWlan = WlanOpenHandle(2) MsgBox(0,"",WlanHostedNetworkQueryStatus($hWlan).HostedNetworkState) WlanCloseHandle($hWlan) Func WlanHostedNetworkQueryStatus($hHandle) Local $tWlan_hosted_network_status = DllStructCreate($tag_WLAN_HOSTED_NETWORK_STATUS) Local $aRet = DllCall($hDll_Wlanapi, 'dword', 'WlanHostedNetworkQueryStatus', 'handle', $hHandle, 'ptr', DllStructGetPtr($tWlan_hosted_network_status), 'ptr', null) If IsArray($aRet) Then If $aRet[0] = 0 Then Return $tWlan_hosted_network_status Else Return SetError(1, $aRet[0], False) EndIf Else return SetError(2, 0, False) EndIf EndFunc Every run it's returning random digit. What's wrong? I just need query hostednetwork state and NUMBER of peers, hostednetwork bssid, not peer list. -
Using Wlanapi.dll in autoit
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
Thanks, for reply. Now im stuck on last structure element: "DWORD dwNumberOfPeers;" that's array of structure: typedef struct _WLAN_HOSTED_NETWORK_PEER_STATE { DOT11_MAC_ADDRESS PeerMacAddress; WLAN_HOSTED_NETWORK_PEER_AUTH_STATE PeerAuthState; } WLAN_HOSTED_NETWORK_PEER_STATE, *PWLAN_HOSTED_NETWORK_PEER_STATE; now mine struct looks: Global $tag_WLAN_HOSTED_NETWORK_STATUS = "INT HostedNetworkState;" & $tag_GUID & ";byte Mac_Address[6];ptr pMacAddress;ulong ulChannelFrequency;dword dwNumberOfPeers;" how will i do that? -
Using Wlanapi.dll in autoit
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
Thanks everyone for help. Now i'am trying to make function: DWORD WINAPI WlanHostedNetworkQueryStatus( _In_ HANDLE hClientHandle, _Out_ PWLAN_HOSTED_NETWORK_STATUS *ppWlanHostedNetworkStatus, _Reserved_ PVOID pvReserved ); But i don't know how to make that output structure in autoit: typedef struct _WLAN_HOSTED_NETWORK_STATUS { WLAN_HOSTED_NETWORK_STATE HostedNetworkState; GUID IPDeviceID; DOT11_MAC_ADDRESS wlanHostedNetworkBSSID; DOT11_PHY_TYPE dot11PhyType; ULONG ulChannelFrequency; DWORD dwNumberOfPeers; WLAN_HOSTED_NETWORK_PEER_STATE PeerList[1]; } WLAN_HOSTED_NETWORK_STATUS, *PWLAN_HOSTED_NETWORK_STATUS; -
Using Wlanapi.dll in autoit
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
Ok, i runned your version but returns error 6 and extended 0. What's wrong? (Runned as administrator) -
Using Wlanapi.dll in autoit
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
bumpppp -
Using Wlanapi.dll in autoit
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
Ohh sorry I didn't know that working this way. So now i will write next functions and tell you if taht works. @Update I write next function but seems not work :/ This will set hostednetwork mode to allow/deny: $wlanHandle = WlanOpenHandle(2) WlanSetMode($wlanHandle, True) Func WlanOpenHandle($dwClientVersion) Local $aRet = DllCall('Wlanapi.dll','dword','WlanOpenHandle', 'dword', $dwClientVersion, 'ptr', Null, 'dword*', 0, 'handle*', 0) If IsArray($aRet) Then If $aRet[0] = 0 Then Return $aRet[4] ;phClientHandle Else Return SetError(1) EndIf Else Return SetError(2) EndIf EndFunc Func WlanSetMode($hHandle, $bAllow) Local $aRet = DllCall("Wlanapi.dll", "dword", "WlanHostedNetworkSetProperty", "handle", $hHandle, "dword", 3, "dword", 1, "bool", $bAllow, "dword", 0, "ptr", Null) If IsArray($aRet) Then If $aRet[0] = 0 Then Return $aRet[6] ;pFailReason Else Return SetError(1) EndIf Else Return SetError(2) EndIf EndFunc What's wrong in this dll call? From msdn: DWORD WINAPI WlanHostedNetworkSetProperty( _In_ HANDLE hClientHandle, _In_ WLAN_HOSTED_NETWORK_OPCODE OpCode, _In_ DWORD dwDataSize, _In_ PVOID pvData, _Out_opt_ PWLAN_HOSTED_NETWORK_REASON pFailReason, _Reserved_ PVOID pvReserved ); So first parameter type "handle" and handle given by previous function, then OpCode enum. From msdn: typedef enum _WLAN_HOSTED_NETWORK_OPCODE { wlan_hosted_network_opcode_connection_settings, wlan_hosted_network_opcode_security_settings, wlan_hosted_network_opcode_station_profile, wlan_hosted_network_opcode_enable } WLAN_HOSTED_NETWORK_OPCODE, *PWLAN_HOSTED_NETWORK_OPCODE; So enable OpCode is number 3 in this case. Second parameter type "dword" and 3 value, third parameter type "dword" and value 1 (boolean bytes size), fourth parameter "bool"? and True/False, fifth "dword*"?, value 0 and that will return in array enum of fail reason, and six parameter null. And fail reason from msdn: DllCall returns fifth parameter = 2 so "wlan_hosted_network_reason_bad_parameters"? -
Using Wlanapi.dll in autoit
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
Thanks but i see that function returns handle in "_Out_ PHANDLE phClientHandle" and you write here null. And in documentatnion "_Out_ PDWORD pdwNegotiatedVersion" can't be null -
Hi, i'm trying to make gui application to use windows netsh.exe. But there is problem because netsh.exe console output is in several languages. So i can't do that by this way. I found on msdn site library called wlanapi.dll. I want to use wlan hostednetwork functions from it but i don't know how to use dll's that much in autoit. Can anyone help me write those functions in autoit? : And other functions that i don't know to view hostednetwork status, turn off.
-
Communication between autoit and php
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
Nobody? -
Communication between autoit and php
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
Anyone else have any ideas? -
Communication between autoit and php
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
I tried, but there's no errors -
Communication between autoit and php
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
Can anyone help? -
Hi, i'm trying to make communication between script in autoit and php script. I tried communication via file but i think it's too slow. Now i trying to make it on TCP but something is wrong and scripts doesn't work. this is the code of scripts: #include <ScreenCapture.au3> TCPStartup() OnAutoItExitRegister("OnAutoItExit") Global $Client _ScreenCapture_SetJPGQuality(35) $Listen = TCPListen("127.0.0.1", 3030, 20) While 1 $Client = TCPAccept($Listen) If $Client <> -1 Then _ScreenCapture_Capture("D:/xampp/htdocs/desktop.jpg") TCPSend($Client, "1") EndIf Sleep(5) WEnd Func OnAutoItExit() TCPShutdown() EndFunc <?php $fp = fsockopen("127.0.0.1", 3030); while(fgets($fp, 2) != "1")) { usleep(5000); } ?> The PHP server is local. I trying to achieve if i execute php script that connecting to tcp autoit server and wait for response string "1" then just exit.
-
Problem with keyboard steering in game
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
You are real ... (fill by yourself ) because those lines working correctly: Global $hGui, $guiTitle, $guiW, $guiH, $hFront, $hBMP, $hBack, $buffW, $buffH, $vDll, _ $aChrs = StringSplit("0:1:2:3:4:5:6:7:8:9:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z", ":"), _ $aDecs = StringSplit("30:31:32:33:34:35:36:37:38:39:41:42:43:44:45:46:47:48:49:4A:4B:4C:4D:4E:4F:50:51:52:53:54:55:56:57:58:59:5A", ":") And that e.g : IDToTexture($aMap[$iX][$iY], _ (($iX - ($oPlayer.X - 5)) * 48) + $oOffset.X, _ (($iY - ($oPlayer.Y - 5)) * 48) + $oOffset.Y) Cheers. -
Problem with keyboard steering in game
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
Because it's only part of mine code but other parts are not important. I don't wanna post all parts of code bacause it's over 2000 lines and the problem is only with steering -
Problem with keyboard steering in game
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
So say what part of code do you need -
Problem with keyboard steering in game
MrKris1224 replied to MrKris1224's topic in AutoIt General Help and Support
Do you understand? It's not problem with continuation of line... It's just doesnt detecting keys when mouse staying... Only when i move mouse and press key it works...