1. Moving windows in Windows

I need tiny utility for moving all windows of running applications to left upper corner of screen. How to do it? I need working code, please. Thanks in advance.

new topic     » topic index » view message » categorize

2. Re: Moving windows in Windows

SnakeCharmer said...

I need tiny utility for moving all windows of running applications to left upper corner of screen. How to do it? I need working code, please. Thanks in advance.

include tinewg.exw   
include std/math.e 
 
sequence rect                                             
sequence app_handles={} 
sequence window_handles= EnumWindows ()          
 
for i=1 to length (window_handles)  do 
    if and_bits ( GetWindowLong (window_handles[i],GWL_STYLE), or_all ({WS_VISIBLE,not(WS_POPUP)})) then  --ingnore POPUPS and Invisible Windows 
        if not(equal( GetText (window_handles[i]),{})) then                                            --ingnore Windows without a Caption 
            app_handles= append (app_handles,window_handles[i]) 
        end if 
    end if 
end for 
 
for i=1 to length(app_handles) do 
    rect=GetWindowRect(app_handles[i]) 
    MoveWindow(app_handles[i],0,0,rect[3]-rect[1],rect[4]-rect[2],True) 
end for 
 

The Library i use (tinewg) is here http://euphoria.indonesianet.de/source.zip
I think this is enough, to see how it works, so you can write the Code for the Win32 Wrapper you use.

Andreas

new topic     » goto parent     » topic index » view message » categorize

3. Re: Moving windows in Windows

Thanks. I tried to solve a problem independently and found example in Archive - Window Finding Functions (wrapper for win32 functions, 2Kb).

I wrote already a little, but your way is simpler. The invention of bicycles is a heavy sin for any programmer. :) Thanks for your work.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu