Sign in to follow this  
Followers 0
coucou

Improving CD DVD switcher

23 posts in this topic

#1 ·  Posted (edited)

Hello,

I've prepared a DVD with an unattended Windows 7 and wnat to add some softwares. As the new softwares are GB sized, I'm looking for buiding 2 DVDs, the first will contain Windows 7 (4GB), the second all other softwares.

To pass from the first DVD to the second I need a DVD switcher. By inspiring from the documentation, I built a the here bellow script, tested, working. I beleive that it can improved.

I'll appreciate any help, especially in Func yesButton().

1) If the computer have 2 DVD drives and both first and second DVD are inserted, the second DVD will launched automatically instead of CDTray($sDrive, "open").

2) After inserting the second DVD, it should getting ride from the Autoplay (see image bellow), disbaling click OK! and runing the .cmd file

Regards

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3> ;enable $WS_POPUP + $WS_CAPTION, $WS_EX_TOOLWINDOW

Opt("GUIOnEventMode", 1)  ; Change to OnEvent mode 
;$mainwindow = GUICreate("CDVD-Switcher", 300, 100) ; with min/max/close buttons 
$mainwindow = GUICreate("CDVD-Switcher", 300, 100, -1, -1, $WS_POPUP + $WS_CAPTION, $WS_EX_TOOLWINDOW) ; w/o min/max/close buttons 
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUICtrlCreateLabel("Do you wish installing softwares?", 30, 10)
$yesbutton = GUICtrlCreateButton("Yes", 70, 50, 60)
$nobutton = GUICtrlCreateButton("No", 170, 50, 60)
GUICtrlSetOnEvent($yesbutton, "yesButton")
GUICtrlSetOnEvent($nobutton, "noButton")

$dummywindow = GUICreate("Dummy window for testing ", 200, 100)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")

GUISwitch($mainwindow)
GUISetState(@SW_SHOW)

While 1
  Sleep(1000)  ; Idle around
WEnd

Func yesButton()
  ;Note: at this point @GUI_CTRLID would equal $yesbutton
  ; Open the CD tray on CDROM
  $aDrives = DriveGetDrive("all")
  If Not @error Then
     For $i = 1 To $aDrives[0]
        If DriveGetType($aDrives[$i] & "\") = "CDROM" Then
            $sDrive = StringUpper($aDrives[$i]) & "\"
            ExitLoop
        EndIf
     Next
  EndIf
  [color="#ff0000"][b]CDTray($sDrive, "open"); to be improved[/b][/color]

[color="#ff0000"][b]  MsgBox(0, "GUI Event", "Insert CD, DVD softwares, then click OK!"); to be improved
  Run(@WindowsDir & "\Setup\scripts\WPI.cmd"); to be improved
[/b][/color]sleep(1000)
Exit
EndFunc

Func noButton()
  ;Note: at this point @GUI_CTRLID would equal $nobutton
  If @GUI_WINHANDLE = $mainwindow Then 
    ;MsgBox(0, "GUI Event", "You clicked No! Exiting...")
    Exit
  EndIf 
EndFunc

Func CLOSEClicked()
  ;Note: at this point @GUI_CTRLID would equal $GUI_EVENT_CLOSE,
  ;@GUI_WINHANDLE will be either $mainwindow or $dummywindow
  If @GUI_WINHANDLE = $mainwindow Then 
    MsgBox(0, "GUI Event", "You clicked CLOSE in the main window! Exiting...")
    Exit
  EndIf 
EndFunc

Posted Image

Posted Image

Edited by coucou

Share this post


Link to post
Share on other sites



To remove min/max/close buttons try these styles / extended style:

$mainwindow = GUICreate("CDVD-Switcher", 300, 100, -1, -1, $WS_POPUP + $WS_CAPTION, $WS_EX_TOOLWINDOW)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Do you have an "proper" Autorun.inf on the disc? That would at least give you the option of displaying your custom program as an option. I think in your function that if OK is clicked, you should open the tray, and wait around until it recognizes either the directory structure of DVD2, a specially named file on DVD2, or the label of DVD2. Also either have a separate scipt that closes the autoplay window if it exists or have an AdlibRegister function in your script that closes the autoplay window if it is exists

Edited by Varian

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

To remove min/max/close buttons try these styles / extended style:

$mainwindow = GUICreate("CDVD-Switcher", 300, 100, -1, -1, $WS_POPUP + $WS_CAPTION, $WS_EX_TOOLWINDOW)

TNX for yr help,

Tested, no success. SciTE4AutoIt3 return return the following error message

G:\CDVD-Switcher.au3 (4) : ==> Variable used without being declared.:
$mainwindow = GUICreate("CDVD-Switcher", 300, 100, -1, -1, $WS_POPUP + $WS_CAPTION, $WS_EX_TOOLWINDOW)
$mainwindow = GUICreate("CDVD-Switcher", 300, 100, -1, -1, ^ ERROR
>Exit code: 1    Time: 0.236

To make it works, I do have to add in line 2

#include <WindowsConstants.au3>

Regards

Edited by coucou

Share this post


Link to post
Share on other sites

Do you have an "proper" Autorun.inf on the disc? That would at least give you the option of displaying your custom program as an option. I think in your function that if OK is clicked, you should open the tray, and wait around until it recognizes either the directory structure of DVD2, a specially named file on DVD2, or the label of DVD2. Also either have a separate scipt that closes the autoplay window if it exists or have an AdlibRegister function in your script that closes the autoplay window if it is exists

TNX for the advice,

1) I have not a "proper" Autorun.inf on the disc. Event I had it, I should not using it, because, I can insert any DVD with Autorun.inf instead check existing the right file to launch.

Here bellow my script improved, but still not as it should be, especially Func yesButton() I did not geta loop success looking for the wpi.exe file.

If the wpi.exe is found, launch it. Otherwise, open CD tray and insert DVD2 until wpi.exe file is found and launched

2) I've added AdlibRegister function but is not working like I want.

In fact, after the CD tray on CDROM opened I get "Insert CD, DVD softwares, then click OK!" child window. Inserting the DVD2 display the AutoPlay which stay open until I click on [OK] child window (see image bellow).

Regards

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3> ; enable $WS_POPUP + $WS_CAPTION, $WS_EX_TOOLWINDOW

AdlibRegister("_Adlib")

Opt("GUIOnEventMode", 1)  ; Change to OnEvent mode 
$mainwindow = GUICreate("CDVD-Switcher", 300, 100, -1, -1, $WS_POPUP + $WS_CAPTION, $WS_EX_TOOLWINDOW); w/o min/max/close buttons 
;$mainwindow = GUICreate("CDVD-Switcher", 300, 100); with min/max/close buttons 
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUICtrlCreateLabel("Do you wish installing softwares?", 30, 10)
$yesbutton = GUICtrlCreateButton("Yes", 70, 50, 60)
$nobutton = GUICtrlCreateButton("No", 170, 50, 60)
GUICtrlSetOnEvent($yesbutton, "yesButton")
GUICtrlSetOnEvent($nobutton, "noButton")

$dummywindow = GUICreate("Dummy window for testing ", 200, 100)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")

GUISwitch($mainwindow)
GUISetState(@SW_SHOW)

While 1
  Sleep(1000)  ; Idle around
WEnd

Func yesButton()
  ;Note: at this point @GUI_CTRLID would equal $yesbutton
$aDrives = DriveGetDrive("CDROM")
If Not @error Then
    For $i = 1 To $aDrives[0]
        If DriveStatus($aDrives[$i]) = "READY" Then
            $sDrive = StringUpper($aDrives[$i])
            ;MsgBox(4096,"Drive " & $i, $sDrive)
            Run($sDrive & "\Software\WPI\WPI.exe")
           If Not FileExists($sDrive & "\Software\WPI\WPI.exe") Then
                CDTray($sDrive, "open");Open the CD tray on CDROM
                MsgBox(0, "GUI Event", "Insert CD, DVD softwares, then click OK!")
                Run($sDrive & "\Software\WPI\WPI.exe")
           Endif 
        ExitLoop
        EndIf
    Next
EndIf
sleep(1000)
Exit
EndFunc

Func noButton()
  ;Note: at this point @GUI_CTRLID would equal $nobutton
  If @GUI_WINHANDLE = $mainwindow Then 
    ;MsgBox(0, "GUI Event", "You clicked No! Exiting...")
    Exit
  EndIf 
EndFunc

Func _Adlib()
If WinExists("AutoPlay", "") Then
   Send("!{F4}")
;   WinClose("AutoPlay")
EndIf
EndFunc   ;==>_Adlib

Posted Image

Share this post


Link to post
Share on other sites

Try this for your Yes() function

Func yesButton()
    ;Note: at this point @GUI_CTRLID would equal $Yesbutton
    Local $Drive = StringLeft(@ScriptDir, 2) ;Returns Drive Letter & colon from current drive
    ToolTip('Please wait...Waiting For Correct Media', (@DesktopWidth / 2.5), (@DesktopHeight / 2.5), ' ', 1, 4)
    Do
        Sleep(10) ;nominal sleep time to ease process consumption but maintain control of the System
        ;Next line closes AutoRun Window
        If WinExists('[REGEXPTITLE:AutoPlay; CLASS:#32770]', '') Then WinClose('[REGEXPTITLE:AutoPlay; CLASS:#32770]', '')
    Until FileExists($Drive & '\Software\WPI\WPI.exe') ;Exit Loop when correct file on current drive is foud
    ToolTip('') ;closes Tooltip
    Run($Drive & '\Software\WPI\WPI.exe')
    Sleep(1000)
    Exit ;Exit current script
EndFunc   ;==>yesButton

Share this post


Link to post
Share on other sites

TNX Varian,

Tested, it freezing at "'Please wait...Waiting For Correct Media', no matter xhat media inserted DVD2 (including wpi.exe) or any (see image bellow).

Moreover, the $Drive would never be @ScriptDir (Hard disk). As the CDVD-Switcher script take place during Windows installation, is allways CDROM.

Regards

Posted Image

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I was assuming that the script would be run from the DVD. I understand that for testing purposes, you would run the script from the hard drive, but in production, if the script was run from the DVD

Local $Drive = StringLeft(@ScriptDir, 2)
would return the drive letter and colon from the DVD drive of the script. That being said...
Func yesButton()
    ;Note: at this point @GUI_CTRLID would equal $Yesbutton
    Local $FoundFile = 0
    ToolTip('Please wait...Waiting For Correct Media', (@DesktopWidth / 2.5), (@DesktopHeight / 2.5), ' ', 1, 4)
    Do
        Local $aDrives = DriveGetDrive('CDROM')
        If Not @error Then
            For $i = 1 To $aDrives[0]
                If DriveStatus($aDrives[$i]) = 'READY' And FileExists($aDrives[$i] & '\Software\WPI\WPI.exe') Then
                    $FoundFile = StringUpper($aDrives[$i]) & '\Software\WPI\WPI.exe'    ;Assign Value to $FoudFile
                    ExitLoop
                EndIf
            Next
        EndIf
        Sleep(10) ;nominal sleep time to ease process consumption but maintain control of the System
        
        ;Next line closes AutoRun Window
        If WinExists('[REGEXPTITLE:AutoPlay; CLASS:#32770]', '') Then WinClose('[REGEXPTITLE:AutoPlay; CLASS:#32770]', '')
    
    Until $FoundFile ;Exit Loop when correct file on a CDROM drive is found
    
    ToolTip('') ;closes Tooltip
    
    Run($FoundFile) ;Runs the File
    
    Sleep(1000)
    Exit ;Exit current script
EndFunc   ;==>yesButton

Edited by Varian

Share this post


Link to post
Share on other sites

Here how the CDVD-Switcher script will run.

1st is on DVD1 (Windows7) %CDROM%\sources\$OEM$\$$\Setup\scripts\CDVD-Switcher.exe.

During Windows7 installation CDVD-Switcher.exe will be copied in C:\Windows\Setup\scripts\ folder

The Autounattend.xml (configuration) file in the DVD1 (Windows7) root contain this command

<FirstLogonCommands>
                 ...
                 ...
                 ...
                <SynchronousCommand wcm:action="add"> 
                   <Order>4</Order> 
                   <Description>Windows Post Install Wizard</Description> 
                   <CommandLine>cmd /C start /wait c:\Windows\Setup\scripts\CDVD-Switcher.exe</CommandLine> 
                </SynchronousCommand> 
            </FirstLogonCommands>

Thas mean, the CDVD-Switcher.exe will be launched from hard drive, testing if the DVD1 has %CDROM%\Software\WPI\WPI.exe file. As is not exists in DVD1 we have to insert DVD2.

Hope is more clear how this will works

Regards

Share this post


Link to post
Share on other sites

MANY TNX varian

tested working :x

BTW, I'm looking for enabling the "Quick Launch" on Widows taskbar for my unattended DVD1.

In fact, is right click on taskbar select new toolbar and add "Quick Launch" folder.

This relate the how to, but it works only with Windows 7 English while I'm using Windows 7 French.

Regards

Share this post


Link to post
Share on other sites

Magnifique, mon ami! Is this project for installing on several machines? If so, I suggest checking out WAIK. Also check out GImagex, an Imagex front end developed here on the forums.

I am not sure where or why the script that you referenced is failing. Can you give any more info?

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Yes mon ami, this project for installing on several machines and I know about WAIK and GImagex.

I added a 1 hour idle timing to CDVD-Switcher script: if no action then exit

Before

While 1
  Sleep(1000)  ; Idle around
WEnd

Now

$iTimer = TimerInit()
Sleep(3600000)  ; Idle 1 hour
While $mainwindow And TimerDiff($iTimer) < 1000 
  Exit
WEnd

Regarding the Quick Launch

just a reminder: I copy all my Quick Launch shortcuts to DVD1 (Windows7) %CDROM%\sources\$OEM$\$Docs\Default User\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch

Therefore during the Windows 7 installain they're copied to C:\Users\(UserName)\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\

Using the Quick Launch in this it will enable enabling the "Quick Launch" on Widows taskbar.

Right now I tested it again, it waiting for folder selection (see image here bellow) and moreover it never exit.

BTW the path C:\Users\(UserName)\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\

for windows is %AppData%\Microsoft\Internet Explorer\Quick Launch\

for AutoIt is @AppDataDir\Roaming\Microsoft\Internet Explorer\Quick Launch\

Merci Beaucoup

Posted Image

Edited by coucou

Share this post


Link to post
Share on other sites

For the quicklaunch bar script, do this to get it to work:

Replace "Ny værktøjslinje" with "New Toolbar - Choose a folder"

Share this post


Link to post
Share on other sites

Ooooppssss Posted Image

I did not seen it

Thank you

Share this post


Link to post
Share on other sites

Ooooppssss Posted Image

I did not seen it

Thank you

Unfortunately coucou, I've tried also like this and don't work for me (Windows 7 Ultimate French version!

I'm always finding an issue!

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

This is all you need to enable the Quick Launch Toolbar. It does not unlock the Taskbar or customize the Quick Launch bar in any way. I have True Launch bar installed so my customization settings (disable text/title, etc.) would not necessarily work for you.

MouseClick('right', 0, @DesktopHeight, 1)
Send('{Up 8}{RIGHT}{DOWN 7}{ENTER}')
WinWait('New Toolbar - Choose a folder')
ControlSetText('New Toolbar - Choose a folder', '', 'Edit1', 'Shell:Quick Launch')
ControlClick('New Toolbar - Choose a folder', '', 'Button1')

Edited by Varian

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Thanks for your reply!

But the fonction ControlClick doesn't work for me!

The cursor gets stuck on "Folder" (Dossier) = Choose a folder !

Edited by myselfidem

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

You should replace with the correct Title for your script

$mPos = MouseGetPos()
MouseClick("right", 0, @DesktopHeight, 1)
Send("{Up 8}{RIGHT}{DOWN 7}{ENTER}")
WinWait("Nouvelle barre d'outils - Chosir un dossier")
ControlSetText("Nouvelle barre d'outils - Chosir un dossier", "", "Edit1", "Shell:Quick Launch")
ControlClick("Nouvelle barre d'outils - Chosir un dossier", "", "Button1")
MouseMove($mPos[0], $mPos[1], 1)

EDIT: I posted wrong title..I'm not very smart lately

Edited by Varian

Share this post


Link to post
Share on other sites

Here my final Quick Launch tested working

1) You may copy all yr Quick Launch shortcuts to DVD1 (Windows7)

for Windows English to %CDROM%\sources\$OEM$\$Docs\Default User\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch

for Windows French to %CDROM%\sources\$OEM$\$Docs\Default User\AppData\Roaming\Microsoft\Internet Explorer\Lancement rapide

2) here the script

;------------------------------------------------------------------
; AutoIt Version: 3.3.0.0
; Author: Andrew Calcutt, wazer
; Last Edited: 09/13/2009
; Script Function: Adds Quick Launch Toolbar
;
;Modified by coucou 18/01/2011
;------------------------------------------------------------------
Opt('TrayIconDebug', 1)
sleep(10)

;Adding Reg Entries.
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSizeMove", "REG_DWORD", "1")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSmallIcons", "REG_DWORD", "1")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarGlomLevel", "REG_DWORD", "2")

;$Lang = RegRead("HKEY_CURRENT_USER\Control Panel\International", "sLanguage")
$Lang = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop", "PreferredUILanguages")
Select
   ;Case $Lang = "FRA";French
   Case $Lang = "fr-FR";French
   $title = "Nouvelle barre d’outils - Choisir un dossier"
   $path = "%AppData%\Microsoft\Internet Explorer\Lancement rapide\"
   $text = "[CLASS:ToolbarWindow32; TEXT:Lancement rapide]"
   ;Case $Lang = "ENU"; English
   Case $Lang = "en-US"; English
   $title = "New Toolbar - Choose a folder"
   $path = "%AppData%\Microsoft\Internet Explorer\Quick Launch\"
   $text = "[CLASS:ToolbarWindow32; TEXT:Quick Launch]"
EndSelect


;Unlock Taskbar
_ToggleTaskbarLock()
;Create Quicklaunch Toolbar
_TaskToolbarWin7("Shell:Quick Launch")
;Get Quick Launch current postion
While 1
    Sleep(100)
    $QUICKLAUNCH = ControlGetPos("[CLASS:Shell_TrayWnd]", "", $text)
    If Not @error Then ExitLoop
WEnd


Func _TaskToolbarWin7($toolbardir)
    MouseClick("right", 0, @DesktopHeight)
    Send("{DOWN}{RIGHT}{UP}{ENTER}")
    WinWaitActive($title)
sleep(1000)
    ControlSetText($title, "", "Edit1", $path)
sleep(1000)
    ControlClick($title, "", "Button1")
EndFunc   ;==>_TaskToolbarWin7


Func _ToggleTaskbarLock()
    MouseClick("right", 0, @DesktopHeight)
    Send("{UP}{UP}{ENTER}")
EndFunc   ;==>_ToggleTaskbarLock

As you can see here above, they are twice $Lang as well as twice Case $Lang

In fact, If you're using a Single Windows Language, then you cas use this

$Lang = RegRead("HKEY_CURRENT_USER\Control Panel\International", "sLanguage")
   Case $Lang = "FRA";French
   Case $Lang = "ENU"; English

Otherwise, If you use a MultiLang Windows as myself, you may use this

$Lang = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop", "PreferredUILanguages")
   Case $Lang = "fr-FR";French
   Case $Lang = "en-US"; English

Enjoy

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

Many thanks wazer , Varian , coucou for your support! :x

At last I've found a solution for me like this:

7QuickLaunch.au3

;------------------------------------------------------------------
; AutoIt Version: 3.3.0.0
; Author: wazer
; Last Edited: 18/01/2011
; Script Function: Adds Quick Launch Toolbar windows 7
;------------------------------------------------------------------
Opt('TrayIconDebug', 1)
sleep(10)

;Adding Reg Entries.
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSizeMove", "REG_DWORD", "1")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSmallIcons", "REG_DWORD", "1")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarGlomLevel", "REG_DWORD", "2")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer", "EnableAutoTray", "REG_DWORD", "0")
RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer", "TaskbarNoPinnedList", "REG_DWORD", "1")
RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2','Settings',"REG_BINARY","28000000ffffffff02000000030000003e0000004e000000feffffffce030000920600001c040000")

;$Lang = RegRead("HKEY_CURRENT_USER\Control Panel\International", "sLanguage")
$Lang = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop\MuiCached", "MachinePreferredUILanguages")
Select
   ;Case $Lang = "FRA";French
   Case $Lang = "fr-FR";French
   $title = "Nouvelle barre d’outils - Choisir un dossier"
   $path = "%AppData%\Microsoft\Internet Explorer\Quick Launch"
   $text = "[CLASS:ToolbarWindow32; TEXT:Quick Launch]"
   $programs = "Applications en cours d’exécution"
   $toolbartext = "{down}{down}{down}{ENTER}"
   $toolbartitle = "{down}{down}{down}{down}{ENTER}"
    
;Case $Lang = "NL; Dutch
Case $Lang = "nl-NL"; Dutch
$title = "Nieuwe werkbalk - Selecteer een map"
$path = "%AppData%\Microsoft\Internet Explorer\Quick Launch\"
$text = "[CLASS:ToolbarWindow32; TEXT:Quick Launch]"
$programs = "[CLASS:MSTaskListWClass; TEXT:Actieve toepassingen]"
$toolbartext = "{down}{down}{down}{ENTER}"
$toolbartitle = "{down}{down}{down}{down}{ENTER}"
   
   ;Case $Lang = "ENU"; English
   Case $Lang = "en-US"; English
   $title = "New Toolbar - Choose a folder"
   $path = "%AppData%\Microsoft\Internet Explorer\Quick Launch\"
   $text = "[CLASS:ToolbarWindow32; TEXT:Quick Launch]"
   $programs = "[CLASS:MSTaskListWClass; TEXT:Running applications]"
   $toolbartext = "{down}{down}{down}{ENTER}"
   $toolbartitle = "{down}{down}{down}{down}{ENTER}"

   ;Case $Lang = "DAN"; Danish
Case $Lang = "da-DK"; Danish
$title = "Ny værktøjslinje - vælg en mappe"
$path = "%AppData%\Microsoft\Internet Explorer\Quick Launch\"
$text = "[CLASS:ToolbarWindow32; TEXT:Quick Launch]"
$programs = "[CLASS:MSTaskListWClass; TEXT:Programmer, der kører]"
$toolbartext = "v{UP}{ENTER}"
$toolbartitle = "v{ENTER}"

    ;Case $Lang = "SE"; Swedish
Case $Lang = "se-SE"; Swedish
$title = "Nytt verktygsfält - välj en mapp"
$path = "%AppData%\Microsoft\Internet Explorer\Quick Launch\"
$text = "[CLASS:ToolbarWindow32; TEXT:Quick Launch]"
$programs = "[CLASS:MSTaskListWClass; TEXT:Program som körs]"
$toolbartext = "{down}{down}{down}{ENTER}"
$toolbartitle = "{down}{down}{down}{down}{ENTER}"

    ;Case $Lang = "NO"; Norwegian
Case $Lang = "nb-NO"; Norwegian
$title = "Ny verktøylinje - velg en mappe"
$path = "%AppData%\Microsoft\Internet Explorer\Quick Launch\"
$text = "[CLASS:ToolbarWindow32; TEXT:Quick Launch]"
$programs = "[CLASS:MSTaskListWClass; TEXT:Kjører programmer]"
$toolbartext = "{down}{down}{down}{ENTER}"
$toolbartitle = "{down}{down}{down}{down}{ENTER}"
  

EndSelect


;Unlock Taskbar
_ToggleTaskbarLock()
;Create Quicklaunch Toolbar
_TaskToolbarWin7("Shell:Quick Launch")
;Get Quick Launch current postion
While 1
    Sleep(100)
    $QUICKLAUNCH = ControlGetPos("[CLASS:Shell_TrayWnd]", "", $text)
    If Not @error Then ExitLoop
WEnd
$TaskBar_CenterHeight = @DesktopHeight - ($QUICKLAUNCH[3] / 2)
;Hide "Quick Launch" toolbar text
MouseClick("right", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, 1, 0)
Send($toolbartext)
$TaskBar_CenterHeight = @DesktopHeight - ($QUICKLAUNCH[3] / 2)
;Hide "Quick Launch" toolbar  title
MouseClick("right", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, 1, 0)
Send($toolbartitle)
;Move "Quick Launch" toolbar
$QUICKLAUNCH = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ToolbarWindow32; TEXT:Quick Launch]")
$TRAY = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASS:ReBarWindow32]")
MouseClickDrag("left", $QUICKLAUNCH[0] - 5, $TaskBar_CenterHeight, $TRAY[0] + 5, $TaskBar_CenterHeight, 0)
;Move "Current Apps" bar
$CURRENTAPPS = ControlGetPos("[CLASS:Shell_TrayWnd]", "", $programs)
MouseClickDrag("left", $CURRENTAPPS[0] - 5, $TaskBar_CenterHeight, $TRAY[0] + 120, $TaskBar_CenterHeight, 0)
;Verrouiller la barre des tâches
_ToggleTaskbarLock() 

Func _TaskToolbarWin7($toolbardir)
    MouseClick("right", 0, @DesktopHeight)
    Send("{UP 8}{RIGHT}{DOWN 4}{ENTER}")
WinActive($title)
    sleep(1000)
sleep(1000)
    ControlCommand($title, "", "Button1", "Check", "")
    ControlClick($title, "", "Button1")
Send("{ENTER}")
EndFunc   ;==>_TaskToolbarWin7


Func _ToggleTaskbarLock()
    MouseClick("right", 0, @DesktopHeight)
    Send("{UP 2}{ENTER}")
EndFunc   ;==>_ToggleTaskbarLock

Working really fine for me!

Cheers

Edited by myselfidem

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0