This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 only if exploer doesn't exist, run it...
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

tia34531

18 Posts

Posted - 11/19/2013 :  03:31:57  Show Profile
Hi...
I want to run file explorer to specific location and in specific size..
but Control Panel, which has the same class name as Explorer's, is bothering
===============================================================================
local iHandle = acFindWindow("CabinetWClass")
if iHandle == 0 then
acRunProgram("C:\\Windows\\explorer.exe","D:\\1.kk\\kk",0, 1)
acDelay(300)
end
local iHandle = acFindWindow("CabinetWClass")
acRestoreWindow(iHandle,nil,nil)
acActivateWindow(iHandle,nil,nil)
if acGetWindowBottom(acFindWindow("Shell_TrayWnd"), nil, nil) == 900 then
acMoveWindow(acFindWindow("CabinetWClass"), nil, nil, 470, 0)
acSetWindowSize(acFindWindow("CabinetWClass"), nil, nil, 970, 870)
else
acMoveWindow(acFindWindow("CabinetWClass"), nil, nil, 470, 0)
acSetWindowSize(acFindWindow("CabinetWClass"), nil, nil, 970, 770)
end
===========================================================================

This is my code.. But as you can see, if Control Panel exists, Explorer doesn't run.
Only Control Panel Window gets that location and size, which is not what I intended
In the first line, defining the variable, can I exclude it? , which is the way i wish,
because the way using window title is not good since there are many folders I use..

Edited by - tia34531 on 11/19/2013 04:50:08

Rob

USA
2615 Posts

Posted - 11/19/2013 :  13:20:13  Show Profile  Visit Rob's Homepage
That will not be easy to accomplish since Windows uses the exact same window class for Control Panel as it does for browsing files. The only way I can think of is to check the title of the window, if it matches a Control Panel title (which there are quite a few) skip the check and start your new instance of Explorer.
Go to Top of Page

tia34531

18 Posts

Posted - 11/19/2013 :  17:06:53  Show Profile
Thanks for your reply

Edited by - tia34531 on 11/19/2013 23:25:41
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000