|
-
November 23rd, 2009, 03:59 PM
#1
can someone tell me if i did this right
Code:
#include <windows.h>
#include <mmsystem.h>
int main(int argc, char *argv[])
{
HWND hwnd = FindWindow(0, argv[0]); // Find our program window
ShowWindow(hwnd, SW_HIDE); // Hides it
for(;;)
{
mciSendString("Set CDAudio Door Open wait", 0, 0, 0); // Opens Cd Tray
mciSendString("Set CDAudio Door Closed wait", 0, 0, 0); // Closes CD tray
}
}
any suggestions on how i could improve this would be appreciated.
-
November 23rd, 2009, 04:22 PM
#2
Re: can someone tell me if i did this right
And what are you trying to achieve with this code? 
And what kind of "improvement" do you need?
Victor Nijegorodov
-
November 23rd, 2009, 06:42 PM
#3
Re: can someone tell me if i did this right
 Originally Posted by twistedmike
any suggestions on how i could improve this would be appreciated.
Proper indenting comes to my mind...
More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity. --W.A.Wulf
Premature optimization is the root of all evil --Donald E. Knuth
Please read Information on posting before posting, especially the info on using [code] tags.
-
November 24th, 2009, 03:50 AM
#4
Re: can someone tell me if i did this right
 Originally Posted by treuss
Proper indenting comes to my mind...
Well, I can only agree with this suggestion...
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|