IPB

Welcome Guest ( Log In | Register )

3 Pages V  < 1 2 3  
Reply to this topicStart new topic
> Shutdowngui For Windows/pe, ShutdownGUI-Plugin
bpl5000
post Sep 22 2005, 06:40 AM
Post #41


Member
**

Group: Members
Posts: 81
Joined: 9-September 05
Member No.: 13,896



Joshua, you rule! That's great code and it works so well. I would like to paste the code that I extracted in case someone else wants to put the CD eject function into their own program. Please note, this is not code for a GUI program... it simple ejects the CD tray. If you want a GUI interface, you need Joshua's code.

CODE
'***Here are things you need to first declare***
  ' // Constants for DeviceSetMedia
   Public Const IOCTL_STORAGE_EJECT_MEDIA As Long = &H2D4808
   Public Const INVALID_HANDLE_VALUE As Long = -1&
   Public Const GENERIC_READ As Long = &H80000000
   Public Const FILE_SHARE_READ As Long = &H1
   Public Const FILE_SHARE_WRITE As Long = &H2
   Public Const OPEN_EXISTING As Long = 3

  ' // Public Functions for DeviceSetMedia
  Public Declare Function CreateFile Lib "kernel32" _
  Alias "CreateFileA" _
 (ByVal lpFileName As String, _
  ByVal dwDesiredAccess As Long, _
  ByVal dwShareMode As Long, _
  lpSecurityAttributes As Any, _
  ByVal dwCreationDisposition As Long, _
  ByVal dwFlagsAndAttributes As Long, _
  ByVal hTemplateFile As Long) As Long
 
  Public Declare Function DeviceIoControl Lib "kernel32" _
 (ByVal hDevice As Long, _
  ByVal dwIoControlCode As Long, _
  lpInBuffer As Any, _
  ByVal nInBufferSize As Long, _
  lpOutBuffer As Any, _
  ByVal nOutBufferSize As Long, _
  lpBytesReturned As Long, _
  lpOverlapped As Any) As Long
 
  Public Declare Function CloseHandle Lib "kernel32" _
  (ByVal hObject As Long) As Long

CODE
'***Here's the function to eject the CD***
Public Function DeviceSetMedia(sDrive As String, ctrlCode As Long) As Boolean
' // Function used to open CD tray
  Dim hDevice As Long
  Dim bytesReturned As Long
  Dim success As Long
 
 'obtain a handle to the device
  hDevice = CreateFile("\\.\" & sDrive, _
                       GENERIC_READ, _
                       FILE_SHARE_READ Or FILE_SHARE_WRITE, _
                       ByVal 0&, _
                       OPEN_EXISTING, _
                       0&, 0&)
  If hDevice <> INVALID_HANDLE_VALUE Then
    'If the operation succeeds,
    'DeviceIoControl returns zero
     success = DeviceIoControl(hDevice, _
                               ctrlCode, _
                               0&, _
                               0&, _
                               ByVal 0&, _
                               0&, _
                               bytesReturned, _
                               ByVal 0&)

  End If
 
  Call CloseHandle(hDevice)
End Function

CODE
'***Here's how to call the function***
sDrive = "D:"
Call DeviceSetMedia(sDrive, IOCTL_STORAGE_EJECT_MEDIA)
'I attempt to open both D and E drive
sDrive = "E:"
Call DeviceSetMedia(sDrive, IOCTL_STORAGE_EJECT_MEDIA)


Thanks again Jushua! I would have been lost without your help. smile.gif
Go to the top of the page
 
+Quote Post
jimshu1
post Oct 12 2005, 03:55 AM
Post #42


Member
**

Group: Members
Posts: 12
Joined: 18-September 05
Member No.: 14,154



I have tried to use this plugin several times, but with no luck. It starts up a DOS box and executes to the 2nd command line, pauses, and then the DOS window closes.

I have three optical drives, and maybe this is the problem. How would I edit the plugin to specify which optical drive to eject from?

Thanks for any help!
Go to the top of the page
 
+Quote Post
Joshua
post Oct 12 2005, 04:09 AM
Post #43


Platinum Member
*****

Group: Members
Posts: 1,680
Joined: 19-September 03
From: Germany, 32839 Steinheim
Member No.: 1,716



QUOTE (jimshu1 @ Oct 12 2005, 10:55 AM)
How would I edit the plugin to specify which optical drive to eject from?
*

this is not possible with this version.
i am working on a new version with more options.
you can also try paragliders shutdown plugin.
http://www.paraglidernc.com/6901.html

Joshua


--------------------
Go to the top of the page
 
+Quote Post
jimshu1
post Oct 12 2005, 08:09 AM
Post #44


Member
**

Group: Members
Posts: 12
Joined: 18-September 05
Member No.: 14,154



Thank you Joshua! I'll give them a try.
Go to the top of the page
 
+Quote Post
bpl5000
post Mar 1 2006, 11:20 AM
Post #45


Member
**

Group: Members
Posts: 81
Joined: 9-September 05
Member No.: 13,896



Hi Joshua,
The code you gave me here to eject the CD worked perfect until I switched from using XP SP1 to XP SP2. Now the eject does not work and I don't even get an error. I switched back to using SP1 and it works fine. Any idea why the cd eject code will not work with SP2?
Thanks!
Go to the top of the page
 
+Quote Post
Joshua
post Mar 1 2006, 11:30 AM
Post #46


Platinum Member
*****

Group: Members
Posts: 1,680
Joined: 19-September 03
From: Germany, 32839 Steinheim
Member No.: 1,716



QUOTE (bpl5000 @ Mar 1 2006, 05:20 PM) *
Any idea why the cd eject code will not work with SP2?

i have no idea. sad.gif
i also use sp2, and for me it works. have you test it under vanilla BartPe?
what is your exact configuration? XPE, Reatago, any other shutdown plugins ?

Joshua


--------------------
Go to the top of the page
 
+Quote Post
Joshua
post May 15 2006, 10:23 AM
Post #47


Platinum Member
*****

Group: Members
Posts: 1,680
Joined: 19-September 03
From: Germany, 32839 Steinheim
Member No.: 1,716



ShutdownGUI plugin V 2.0 is ready for download.
much smaller.
no more need to copy it to ramdisk.
you can remove your cd before shutdown.
cd drive will be closed automatic after you remove your cd.

Joshua


--------------------
Go to the top of the page
 
+Quote Post
SLK001
post May 17 2006, 08:19 AM
Post #48


Silver Member
***

Group: Members
Posts: 104
Joined: 24-April 06
Member No.: 18,922



Running a simple, plain vanilla BartPE XP w/SP2 disk, I get the same problem as the last version.

Running the program under basic Bart gives you this error:

CODE
RUN-TIME ERROR '50003':
UNEXPECTED ERROR
Go to the top of the page
 
+Quote Post
Joshua
post May 17 2006, 03:15 PM
Post #49


Platinum Member
*****

Group: Members
Posts: 1,680
Joined: 19-September 03
From: Germany, 32839 Steinheim
Member No.: 1,716



QUOTE (SLK001 @ May 17 2006, 03:19 PM) *
Running the program under basic Bart gives you this error:
CODE
RUN-TIME ERROR '50003':
UNEXPECTED ERROR

if you don't use a vb-plugin, you have to use this shutdownGUI.inf

QUOTE
; PE Builder v3 plug-in INF file
; by Joshua
; V2.0 - 17.05.2006

[Version]Signature= "$Windows NT$"

[PEBuilder]
Name="Shell: PE-Shutdown-GUI"
Enable=1
Help="Shutdown.htm"

[WinntDirectories]

[SourceDisksFiles]
ShutdownGUI.exe=2,,1
Shutdown.ini=2,,1
msvbvm60.dll=2,,1
asycfilt.dll=2,,1

[Append]
nu2menu.xml, ShutdownGUI_nu2menu.xml


Joshua


--------------------
Go to the top of the page
 
+Quote Post
SLK001
post May 19 2006, 09:38 AM
Post #50


Silver Member
***

Group: Members
Posts: 104
Joined: 24-April 06
Member No.: 18,922



Thanks Joshua,

Having those dependencies in the system32 folder fixed the problem (I didn't have the asycfilt.dll file).

Also, as a heads-up, ewido anti-malware reports a "Backdoor.Bifrose.d" infection in ShutdownGUI.exe. Neither Norton AV nor Kaspersky AV report any issues. Makes me wonder about ewido's scan technique.
Go to the top of the page
 
+Quote Post
chris
post May 3 2009, 10:10 AM
Post #51


Member
**

Group: Members
Posts: 12
Joined: 5-September 07
From: United Kingdom
Member No.: 30,932



QUOTE (SLK001 @ May 19 2006, 10:38 AM) *
Thanks Joshua,

Having those dependencies in the system32 folder fixed the problem (I didn't have the asycfilt.dll file).

Also, as a heads-up, ewido anti-malware reports a "Backdoor.Bifrose.d" infection in ShutdownGUI.exe. Neither Norton AV nor Kaspersky AV report any issues. Makes me wonder about ewido's scan technique.

Hi everyone I no this thread is a few years old so I am hoping that there maybe a solution to my
problem.I am using Joshua's ShutdownGUI Version 2.0 Plugin in my Bart's PE ISO.
Has anyone managed to modify it so that it replaces XPE Shutdown Duologue box that comes with
XPE 1.0.7.At the moment the Plugin is working great on the Nu2Menu but I would like to remove
it from the Nu2Menu and simply use it to replace XPE shutdown menu much in the same fashion
as normal XP Shutdown Restart etc etc.
I get the impression after reading a vast number of post in the Forum that this is more difficult to achieve than mite be first thought.If anyone has a solution to this problem I would be most
great full if someone could put me write.

This is Joshua's code for the Nu2Menu which is working fine I have also added two additional dll's
to the plugin without these it will not work.
msvbvm60.dll
asycfilt.dll
CODE
[/code]<!-- Nu2Menu entry for ShutdownGUI -->
<NU2MENU>
    <MENU ID="Startmenu">
        <MITEM TYPE="SEPARATOR"></MITEM>
        <MITEM TYPE="POPUP" MENUID="Shut_Down">Turn Off Computer</MITEM>
    </MENU>
    
    <MENU ID="Shut_Down">
            <MITEM TYPE="ITEM" DISABLED="@Not(@FileExists(@GetWinDir()\system32\ShutdownGUI.exe))" CMD="RUN" FUNC="@GetWinDir()\system32\ShutdownGUI.exe">Shutdown-GUI</MITEM>
    </MENU>
</NU2MENU>[code]

My setup is as follows
XP Pro SP3 ------- as the source files
Bart's PE 3.1.10a
XPE 1.0.7
Windows Blinds 5.0
Post precessing 2.2
ShutdownGUI
and many other additional plugins
Go to the top of the page
 
+Quote Post
chuckr
post May 4 2009, 08:12 AM
Post #52


Silver Member
***

Group: Members
Posts: 194
Joined: 4-December 06
From: Littleton, CO, USA
Member No.: 23,659



QUOTE (chris @ May 3 2009, 08:10 AM) *
Hi everyone I no this thread is a few years old so I am hoping that there maybe a solution to my
problem.I am using Joshua's ShutdownGUI Version 2.0 Plugin in my Bart's PE ISO.
Has anyone managed to modify it so that it replaces XPE Shutdown Duologue box that comes with
XPE 1.0.7.At the moment the Plugin is working great on the Nu2Menu but I would like to remove
it from the Nu2Menu and simply use it to replace XPE shutdown menu much in the same fashion
as normal XP Shutdown Restart etc etc.
I get the impression after reading a vast number of post in the Forum that this is more difficult to achieve than mite be first thought.If anyone has a solution to this problem I would be most
great full if someone could put me write.

This is Joshua's code for the Nu2Menu which is working fine I have also added two additional dll's
to the plugin without these it will not work.
msvbvm60.dll
asycfilt.dll

Hi chris,
This looked like an interesting post, so i D/L Joshua's .CAB from his posted website.
Then worked with that for a little bit...

Did a quick build, to try to implement nuMe's .xml suggestions for double "SystemTools", one word (with some slight mods).

Got about this far, and things didn't work right. The D/L .CAB was obviously older than his above post,
and the D/L .inf file did NOT include the added 2 lines:
msvbvm60.dll=2,,1
asycfilt.dll=2,,1

Nor did the .CAB file include the two VB files.
So, I was running without these two, and obviously it doesn't work without those 2 files.

(Now, since Ed_P does not have the "Attachments Editor" enabled in this forum, I gotta post elsewhere:)
Got about this far, so I don't understand why something like this isn't "do-able", or exactly what the "difficulties" are:

http://www.911cd.net/forums//index.php?s=&...st&p=156441

Don't have the 2 .dlls (yet) so I'll have to hunt those down.

An interesting 'circumstance' appeared during this fruitless checkout, however:
I shoved a CD into my CDreader before I clicked the "Eject" option (to checkout the eject, naturally),

then got a dialog-box that said: "Please insert a disk into drive X:"

Which was rather funny, because there was a CD_disk in the CDROM device O:,
and my boot device (the real drive X:) was a USB stick...

Which leads me to believe that the .EXE assumes that the (booted) %SystemDrive% is always the CDROM...

At any rate, it was a fun thing to do and I'm sure that Joshua will come on-board here soon.

BTW, the only change I made was to the .inf, adding 3 lines:
QUOTE
;; 05/03/2009 jcr added:
[Software.AddReg]
0x2,"Sherpya\XPEinit\Desktop","Shutdown GUI","%SystemRoot%\system32\ShutdownGUI.exe||%SystemRoot%\system32\shell32.dll,109"
0x2,"Sherpya\XPEinit\Programs","Shutdown GUI","%SystemRoot%\system32\ShutdownGUI.exe||%SystemRoot%\system32\shell32.dll,109"


If you don't like the 'No Smoking' icon, you can replace the '109' at the end of both lines,
with the number of an icon that you like, using this chart (Thanks again, Fuwi!): sorcerer.gif
(223 looks cool, but kinda blurry)
http://www.911cd.net/forums//index.php?s=&...st&p=155413

Note that this does NOT REPLACE the current 1.0.7 'Shutdown' button, simply adds another one.
Nor does it disturb the original BartPE button.
I use XPE 1.0.6, so things might be different for you.










--------------------
There are only 10 kinds of people in this world: Those who know binary and those who don't...
Go to the top of the page
 
+Quote Post
Ed_P
post May 4 2009, 10:38 AM
Post #53


Platinum Member
*****

Group: Admin
Posts: 4,615
Joined: 12-August 05
From: Western NY, USA
Member No.: 13,258



The VBsupport plugin adds the two missing files msvbvm60.dll and asycfilt.dll. It needs to be enabled.


--------------------

A useful posting: Adding drivers to BartPE; NIC, SATA, video

A helpful thread: BartPE Troubleshooting FAQs

Use the forum's search tool to find postings about problems similar to yours.
For searches involving three letter acronyms such as USB add an * to the end. For example: USB*

The button is your friend and is located just below the one for Quote Reply.



Ed
Go to the top of the page
 
+Quote Post
Joshua
post May 4 2009, 12:18 PM
Post #54


Platinum Member
*****

Group: Members
Posts: 1,680
Joined: 19-September 03
From: Germany, 32839 Steinheim
Member No.: 1,716



QUOTE (Ed_P @ May 4 2009, 05:38 PM) *
The VBsupport plugin adds the two missing files msvbvm60.dll and asycfilt.dll. It needs to be enabled.

Yes, nothing more to say for me. thumbsup.gif

Joshua


--------------------
Go to the top of the page
 
+Quote Post
chris
post May 4 2009, 01:24 PM
Post #55


Member
**

Group: Members
Posts: 12
Joined: 5-September 07
From: United Kingdom
Member No.: 30,932



QUOTE (Joshua @ May 4 2009, 12:18 PM) *
Yes, nothing more to say for me. thumbsup.gif

Joshua

Many thanks to chuckr Ed P and Joshua for there quick response.As I said in my original post
I have Joshua's ShutdownGUI version 2 working without any issues.At the moment I have it
ruining under a new menu "Turn off Computer" on the Program's menu.The CD Draw opens and
there is plenty of time to take out the CD the shutdown is a Little slow but not uncomfortably slow.
Regarding the icons they appear fine to me and I would like to give a big thanks to Chuckr for
giving me a link to the icons chart.I can see what the numbers mean in the last line in of his post.
In addition I have added the flowing dll's to my INF
msvbvm60.dll
asycfilt.dll
These can be found in system32 folder or use the windows search function and then do a Control Copy and place them on the desktop for easer access.After that simply add them to the Plugin here
is my INF.

CODE
[/code]
; PE Builder v3 plug-in INF file
; by Joshua
; V2.0 - 13.05.2006

[Version]
Signature= "$Windows NT$"

[PEBuilder]
Name="Shell: PE-Shutdown-GUI"
Enable=1
Help="Shutdown.htm"

[WinntDirectories]

[SourceDisksFiles]
ShutdownGUI.exe=2,,1
Shutdown.ini=2,,1
msvbvm60.dll=2,,1
asycfilt.dll=2,,1

[Append]
nu2menu.xml, ShutdownGUI_nu2menu.xml
[code]


As I am a newbe at Bart's Pe it is going to take me some time to get my head around chuckr extra
code which i will add to this INF.I will also do some more research into Vb_Plugin suggested by Ed P
anyway a big thanks to everyone for there help and support.I will post here again when i have
tried this extra code.

Many Thanks Chris UK


Go to the top of the page
 
+Quote Post
chuckr
post May 4 2009, 08:18 PM
Post #56


Silver Member
***

Group: Members
Posts: 194
Joined: 4-December 06
From: Littleton, CO, USA
Member No.: 23,659



QUOTE (Ed_P @ May 4 2009, 08:38 AM) *
The VBsupport plugin adds the two missing files msvbvm60.dll and asycfilt.dll. It needs to be enabled.

Bart didn't include that plugin with his download of the original "pebuilder3110a.exe",
and it's not in Sherpya's XPE_1.0.6.cab download either, so enabling it isn't possible right now...

I don't have Visual Basic or Visual C++ or anything like that...

Just 'Notepad'... hug.gif

Yup, there they are in \system32... Thanks, chris.
asycfilt.dll = Application Extension
msvbvm60.dll = Visual Basic Virtual Machine

I'll make Bart fetch 'em from the source install \I386 directory:
ASYCFILT.DL_
MSVBVM60.DL_

P.S.:
If you also use UBCD4Win, there's some interesting stuff to read at:
C:\UBCD4W_350\oem1\shutdown08\ Shutdown.inf
Plugin was written by 'ParaGlider'. Read the .htm.


This post has been edited by chuckr: May 4 2009, 09:44 PM


--------------------
There are only 10 kinds of people in this world: Those who know binary and those who don't...
Go to the top of the page
 
+Quote Post
Ed_P
post May 4 2009, 10:25 PM
Post #57


Platinum Member
*****

Group: Admin
Posts: 4,615
Joined: 12-August 05
From: Western NY, USA
Member No.: 13,258



For the VBsupport plugin see this posting: http://www.911cd.net/forums//index.php?s=&...ost&p=51245


--------------------

A useful posting: Adding drivers to BartPE; NIC, SATA, video

A helpful thread: BartPE Troubleshooting FAQs

Use the forum's search tool to find postings about problems similar to yours.
For searches involving three letter acronyms such as USB add an * to the end. For example: USB*

The button is your friend and is located just below the one for Quote Reply.



Ed
Go to the top of the page
 
+Quote Post
paraglider
post May 5 2009, 06:31 AM
Post #58


Titanium Member
*******

Group: Moderator
Posts: 5,544
Joined: 29-August 03
From: NC, USA
Member No.: 1,527



My shutdown utilities work on any PE not just UBCDWin and are written in MSVC 6.0 C++ so should have no dependencies. They are downloadable from:

http://www.paraglidernc.com/plugins/plugins.htm

Click the usage link on the above page for further information.

They use the same mechanism to eject the drive so will have the same problems ejecting the boot drive as Joshua's solution. They also provide their own gui and can intercept the shutdown calls from explorer.

This post has been edited by paraglider: May 5 2009, 06:32 AM


--------------------
Go to the top of the page
 
+Quote Post

3 Pages V  < 1 2 3
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 20th November 2009 - 06:15 PM