SetWnd8
This program is useful if you have a window that is either off the screen and you don't know how to get it back, or if a window just disappears. Though such things don't usually happen, to most people, it's still nice to have a tool that can get a window back for you.
You do not need to install anything, to run this program; you just run the executable, and it does its job.
This program waits for 8 seconds before starting to do anything. That is because it gives you time to activate (click on, in the task-bar) the window you are trying to reset.
After 8 seconds, it does a few things: 1) re-size the currently active window 2) make sure the currently active window is showing
The currently-active window is re-sized to 100x100 pixels and re-positioned to 100x100 (pixels). You can re-size it to whatever size you want, after the program is done; same applies for re-positioning.
You do not need to install anything, to run this program; you just run the executable, and it does its job.
This program waits for 8 seconds before starting to do anything. That is because it gives you time to activate (click on, in the task-bar) the window you are trying to reset.
After 8 seconds, it does a few things: 1) re-size the currently active window 2) make sure the currently active window is showing
The currently-active window is re-sized to 100x100 pixels and re-positioned to 100x100 (pixels). You can re-size it to whatever size you want, after the program is done; same applies for re-positioning.
So what, exactly, does this program do?
The pseudo-code for this program is very simple. All it does is:
#define NEW_X 100
#define NEW_Y 100
#define NEW_W 100
#define NEW_H 100
Sleep(8000);
hWnd= GetForegroundWindow();
SetWindowPos(hWnd, 0, NEW_X, NEW_Y, NEW_W, NEW_H, SWP_SHOWWINDOW);
ShowWindow(hWnd, SW_SHOWNORMAL);
UpdateWindow(hWnd);
ExitProcess(0);
So it waits for 8000 milliseconds.
Then it gets the foreground window.
Then it re-positions and re-sizes that window.
Then it tries to make sure the window is being showed normally.
Then it updates the window.
And, finally, it exits, returning zero.
Then it gets the foreground window.
Then it re-positions and re-sizes that window.
Then it tries to make sure the window is being showed normally.
Then it updates the window.
And, finally, it exits, returning zero.
Pretty simple, huh? At least more simple than just about any other of my programs.
If you want to know exactly exactly what the program consists of, then here's the source code:
.386
.model flat, stdcall
option casemap:none
include \RS\include\ifiles.inc
.data
.data?
hWnd DWORD ?
.const
NEW_X equ 100
NEW_Y equ 100
NEW_W equ 100
NEW_H equ 100
.code
start:
push dword ptr 8000
call Sleep
call GetForegroundWindow
mov dword ptr [hWnd], eax
push dword ptr SWP_SHOWWINDOW
push dword ptr NEW_H
push dword ptr NEW_W
push dword ptr NEW_Y
push dword ptr NEW_X
push dword ptr 0
push dword ptr [hWnd]
call SetWindowPos
push dword ptr SW_SHOWNORMAL
push dword ptr [hWnd]
call ShowWindow
push dword ptr [hWnd]
call UpdateWindow
push dword ptr 0
call ExitProcess
end start
The 'include', at the start of the file, just includes another file that basically includes some more files, such as windows.inc, kernel32.inc, user32.inc, and so on.
Click on the 'Download File' link, to download the program file.
| setwnd8.exe | |
| File Size: | 10 kb |
| File Type: | exe |