Search found 346 matches

by cyruz
15 Sep 2019, 20:12
Forum: Bug Reports
Topic: WinGetPos - broken when composition is enabled
Replies: 3
Views: 1506

WinGetPos - broken when composition is enabled

Hi lexikos, I just step on this issue every now and then, so I decided to report a bug. The position values of WinGetPos are not correct when composition is enabled. With composition enabled DwmGetWindowAttribute with DWMWA_EXTENDED_FRAME_BOUNDS should be used instead of GetWindowRect to get the rig...
by cyruz
13 Sep 2019, 22:26
Forum: Scripts and Functions (v1)
Topic: hWnd_to_hBmp() : Capture full screen, Window, Control or user defined area of these
Replies: 23
Views: 9361

Re: hWnd_to_hBmp() : Capture full screen, Window, Control or user defined area of these

BTW, it is possible to disable Window composition per window in Win 7 / Wn 10. But capture works only in Win 7 ( exact PrintWindow() output. ) Win 10 produces a black/blank image. DllCall("dwmapi\DwmSetWindowAttribute","Ptr",hwnd, "UInt",2, "PtrP",1, "UInt",4) ; Disable Sleep 500 ; Allow time for w...
by cyruz
13 Sep 2019, 20:47
Forum: Scripts and Functions (v1)
Topic: hWnd_to_hBmp() : Capture full screen, Window, Control or user defined area of these
Replies: 23
Views: 9361

Re: hWnd_to_hBmp() : Capture full screen, Window, Control or user defined area of these

SKAN wrote:
13 Sep 2019, 15:27
I just tested in Win10.
Everything seems to work fine except trying to capture a WS_POPUP with caption bar.
This is strange, which Windows 10 version are you using? I'm on 1803 and that's the result :(
by cyruz
13 Sep 2019, 07:01
Forum: Scripts and Functions (v1)
Topic: hWnd_to_hBmp() : Capture full screen, Window, Control or user defined area of these
Replies: 23
Views: 9361

Re: hWnd_to_hBmp() : Capture full screen, Window, Control or user defined area of these

... I'm trying on Windows 10 and actually almost no part of the window get screenshotted correctly, moreover there are some issues regarding window size: https://i.imgur.com/JgzIJQH.png On Windows 10 composition cannot be disabled so it should be taken into account when creating the screenshot. I'm...
by cyruz
10 Sep 2019, 03:58
Forum: Scripts and Functions (v1)
Topic: hWnd_to_hBmp() : Capture full screen, Window, Control or user defined area of these
Replies: 23
Views: 9361

Re: hWnd_to_hBmp() : Capture full screen, Window, Control or user defined area of these

Hello SKAN, missed your code format style a lot :D :D Regarding this function, I experimented with this stuff and looks like the only clean way to have a screenshot of a window it's the PrintWindow function. Using the screen DC it's a solution but you must put the windows in foreground before taking...
by cyruz
19 Aug 2019, 19:33
Forum: Ask for Help (v1)
Topic: What's wrong with this GDIP code to screenshot a Window?
Replies: 8
Views: 1562

Re: What's wrong with this GDIP code to screenshot a Window?

About the code, looks like using a DC from the window it is not possible to capture the "themed" parts of a window. The screen DC must be used and the windows coordinates must be relative to the screen. An alternative solution is the PrintWindow Win32 API but it's blocking and if you need to further...
by cyruz
18 Aug 2019, 08:23
Forum: Ask for Help (v1)
Topic: What's wrong with this GDIP code to screenshot a Window?
Replies: 8
Views: 1562

Re: What's wrong with this GDIP code to screenshot a Window?

When you write dllcall("function") ahk replaces it with dllcall(578662355) where the numbers are the proc address of function, if function resides in a dll which is ordinarily loaded before the script starts . The following dlls are documented to be loaded before the script starts, User32.dll, Kern...
by cyruz
18 Aug 2019, 06:25
Forum: Ask for Help (v1)
Topic: What's wrong with this GDIP code to screenshot a Window?
Replies: 8
Views: 1562

Re: What's wrong with this GDIP code to screenshot a Window?

I didn't investigate your code, but note that, : If DllCall's first parameter is a literal string such as "MulDiv" and the DLL containing the function is ordinarily loaded before the script starts, the string is automatically resolved to a function address. This built-in optimization is more effect...
by cyruz
18 Aug 2019, 06:01
Forum: Ask for Help (v1)
Topic: What's wrong with this GDIP code to screenshot a Window?
Replies: 8
Views: 1562

What's wrong with this GDIP code to screenshot a Window?

Hi guys, I wrote this code (trying to squeeze as much speed as possible, due to the need to run it in a loop), but I have this issue: when I try to screenshot a window client only area, I receive a black bar on top, when I try to screenshot a NON-client area, the border is all transparent. #SingleIn...
by cyruz
17 Aug 2019, 09:07
Forum: Scripts and Functions (v1)
Topic: [FUNCTION] WaitForServer - Wait for a server to be up and running
Replies: 3
Views: 1216

Re: [FUNCTION] WaitForServer - Wait for a server to be up and running

Hi. Note that sizeof_WSAData := a_ptrsize == 8 ? 408 : 400 and that dSocket := DllCall("Ws2_32.dll\socket", Int,2, Int,1, Int,6, Int ) should be dSocket := DllCall("Ws2_32.dll\socket", Int,2, Int,1, Int,6, "uptr" ) and hence all UInt ,dSocket should be "uptr" , dSocket . Further, are you certain Ws...
by cyruz
06 Aug 2019, 07:35
Forum: Scripts and Functions (v1)
Topic: [FUNCTION] WaitForServer - Wait for a server to be up and running
Replies: 3
Views: 1216

[FUNCTION] WaitForServer - Wait for a server to be up and running

Hello guys, I created this function to avoid importing a full socket implementation when we just need to check for a server to be up and running. It uses the WSAConnectByName function, that doesn't need any SOCKADDR structure and whatever else... ; ---------------------------------------------------...
by cyruz
29 Jul 2019, 05:08
Forum: Scripts and Functions (v1)
Topic: [CLASS] LiveThumb - DWM thumbnail implementation
Replies: 16
Views: 6795

Re: [CLASS] LiveThumb - DWM thumbnail implementation

This is great! Is it possible to make a LiveThumb out of one whole screen (include all the windows visible on that screen) or out of one XYWH rectangle area of a screen? To display on another screen also connected to the PC. No, you must choose a top level window and you can eventually request an a...
by cyruz
28 Jul 2019, 10:07
Forum: Scripts and Functions (v1)
Topic: [CLASS] LiveThumb - DWM thumbnail implementation
Replies: 16
Views: 6795

Re: [CLASS] LiveThumb - DWM thumbnail implementation

Nice :thumbup: . A few notes. When you return false from the constructor, the destructor will be called and you will call LocalFree regardless of whether these have been allocated or not. You will also do LiveThumb.OBJ_COUNTER -= 1 without the corresponing increment, so you will mess up your count....
by cyruz
28 Jul 2019, 05:06
Forum: Scripts and Functions (v1)
Topic: [CLASS] LiveThumb - DWM thumbnail implementation
Replies: 16
Views: 6795

[CLASS] LiveThumb - DWM thumbnail implementation

Hello guys, this is an implementation of the DWM api part related to the thumbnail management. Thanks to maul-esel that already implemented something similar (https://github.com/maul-esel/AeroThumbnail) but I wanted and implementation that would reflect the API usage patterns, so here we are. * Fixe...
by cyruz
26 Jul 2019, 06:12
Forum: Ask for Help (v1)
Topic: Help defining the logic of a window thumbnails preview program
Replies: 3
Views: 437

Re: Help defining the logic of a window thumbnails preview program

Hi Helgef,

I didn't explain it fully :monkeysay: , because I actually plan to use dwm (I already create a class implementing thumbnail management), this approach is only for fallback.
by cyruz
26 Jul 2019, 05:49
Forum: Ask for Help (v1)
Topic: Help defining the logic of a window thumbnails preview program
Replies: 3
Views: 437

Help defining the logic of a window thumbnails preview program

Hello guys, I'm coding a tool that will work similarly to an alt-tab switcher but it will be specific for classes of windows. Every time the hotkey fires, it shows a fullscreen preview of the windows disposed in a matrix. The snapshotting code is done with GDI and the "PrintWindow" function. There i...
by cyruz
23 Jul 2019, 10:11
Forum: Scripts and Functions (v1)
Topic: [CLASS] Mutex
Replies: 2
Views: 1939

Re: [CLASS] Mutex

Hi, this looks well made :thumbup:. It seems like if a script uses multiple mutex handles, with your wait function, you can only wait for one of them at a time. Thanks for sharing, cheers. Hi Helgef, yes as of now every object represents a mutex and can be waited for only singularly. I guess a hypo...
by cyruz
22 Jul 2019, 20:50
Forum: Scripts and Functions (v1)
Topic: [CLASS] Mutex
Replies: 2
Views: 1939

[CLASS] Mutex

Hi guys, this is a simple mutex implementation I used for concurrent logging (among processes). I'm sharing it to spare some minutes to anybody who needs it. How to use: Create the mutex object. Wait for it (gives ownership). Do some job. Release it. Destroy the object when finished, releasing all v...
by cyruz
04 Jun 2019, 16:20
Forum: Scripts and Functions (v1)
Topic: [APP] FileScrambler - Simple file camouflaging tool
Replies: 4
Views: 1885

Re: [APP] FileScrambler - Simple file camouflaging tool

DataLife wrote:
16 May 2019, 20:25
This works great.

Is the debug log file necessary? Can I disable it?

Hi DataLife, sorry for the late answer.

Not required at all, there is a global variable that you can safely set to 0 in the script header.


Cheers :)
by cyruz
03 Apr 2019, 22:02
Forum: Scripts and Functions (v1)
Topic: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit
Replies: 95
Views: 74459

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

Quick update and code merged in the OP.

@jeeswg that's interesting, if you or JoeWinograd come up with a solution for Windows 10 to "unhide" the icons it would be a nice addition.

Go to advanced search