How to create GUI on the windows7 Desktop?

In summary: Although it wouldn't precisely be "on the desktop", an appropriate way to accomplish this would be to write an application that places an icon in the system tray so that, when you right-click the icon, you can run the application, or exit it, or whatever.
  • #1
Nate Duong
126
3
Dear Group,

I am trying to to build a button ( with rectangle size) on the desktop of windows7,

Whenever I click on that button, it will connect to batch file (which I created for some function) and run that batch file (filename.bat),

Can you give me ideals that how to have that button on the desktop? I had some research and most people use python and java, but I would like to know a specific software which easiest to help me get that point.

Please help!

Thank you, Group.



Nate Duong.
 
Computer science news on Phys.org
  • #2
If you have no previous programming experience you would probably find Visual BASIC to be the easiest way to produce a simple app for Windows like you describe.
 
  • Like
Likes Nate Duong
  • #3
Would a shortcut do? Eg just create a shortcut to the batch file and put it on the desktop.
 
  • Like
Likes Vanadium 50 and FactChecker
  • #4
That should work, though It might be necessary to invoke the command line program with the batch file supplied as a parameter.
Probably not though, the OS would most likely figure out for itself that it needs to run the command line program.
However that approach won't allow for the possibility to have a rectangular depressable button.
 
Last edited:
  • #5
CWatters said:
Would a shortcut do? Eg just create a shortcut to the batch file and put it on the desktop.
Dear CWatters,

I've done that ideal but I really do not like it, it is not professional, But thank you so much for your help...
 
  • #6
rootone said:
If you have no previous programming experience you would probably find Visual BASIC to be the easiest way to produce a simple app for Windows like you describe.

Dear Rootone,

Thank you for your recommendation, let me try to work on it,

Regards,

Nate Duong.
 
  • #7
Good luck! :smile:
 
  • #8
Nate Duong said:
Dear CWatters,

I've done that ideal but I really do not like it, it is not professional, But thank you so much for your help...
The professional way is to use the system to get the job done in the simplest, most reliable way. A shortcut will do that. If you want the rectangle icon, you can convert a .jpg to .ico file type and change the shortcut icon. Google will give you links to conversion programs.

If you are more interested in learning how to do graphics, that is another thing entirely. Visual Basic, Open GL, and Microsoft Foundation Class are some options.
 
  • #9
Professional way is to not introduce new elements of the GUI to not confuse users - it is a so called principle of least astonishment. I have no "buttons" on my desktop and I wouldn't know what to expect from one if it will appear. Shortcuts on the other hand are quite typical and it is obvious they will start some kind of action.
 
  • Like
Likes FactChecker
  • #10
Nate Duong said:
Dear Group,

I am trying to to build a button ( with rectangle size) on the desktop of windows7,

Whenever I click on that button, it will connect to batch file (which I created for some function) and run that batch file (filename.bat),

Can you give me ideals that how to have that button on the desktop? I had some research and most people use python and java, but I would like to know a specific software which easiest to help me get that point.

Please help!

Thank you, Group.
Nate Duong.
I am not sure you can change the GUI in Windows. I think the closest you're going to get to buttons on your desktop that you can program would be widgets.

Windows has a "side bar" where you can load widgets, people often have the clock and CPU meter there. You can create your own widget and place it there, program it with buttons that execute some code when clicked.

I've never built one so I'm afraid I cannot guide you on what to do. I would start with googling something like "create Microsoft widget" or "create sidebar widget"

I would imagine it would be done in visual studio, visual studio express is the free version you can download.

Hope this helps.
Cheers
 
  • #11
Routaran said:
I am not sure you can change the GUI in Windows. I think the closest you're going to get to buttons on your desktop that you can program would be widgets.

Although it wouldn't precisely be "on the desktop", an appropriate way to accomplish this would be to write an application that places an icon in the system tray so that, when you right-click the icon, you can run the application, or exit it, or whatever.

The difficulty really is, that Windows GUI applications have some issues when they call a batch file, because they cannot ascertain when the batch file has completed it's work. There are clunky workarounds, subject to occasional issues, such as using file creation semaphones.

I have written system tray apps using Visual Studio and it's not difficult per se, but it is a little bit arcane. Code samples are likely freely available on the world wide web.
 
  • Like
Likes Silicon Waffle
  • #12
Honestly, if you really want a button that you click once, just write a batch script and put it in there.
It's on your gui and you have to click it once just like a button and then it does exactly what you want.
 

Attachments

  • Screenshot from 2015-12-22 10:24:59.png
    Screenshot from 2015-12-22 10:24:59.png
    1.8 KB · Views: 444
  • #13
Ideally, the shortcut solution described above is the best way.
There is no way to actually have an interactive button on the desktop buffer.

What you can do, if you really must have a the button on the desktop itself, is to create a WINDOWLESS program that draws directly to the desktop buffer and checks for mouseclick on the button to call the batch file. This is not ideal and contrary to good programming practice.

There is no double buffering performed on the deskto background, it is simply drawn first onto the screen and then windows are drawn over it.

Also, since Windows Vista, the DWM (Desktop Window Manager) will only redraw certain parts of the desktop and taskbar at certain times to make things a little faster - your button will be flickery and may be corrupted with mouse interaction etc. frequently.

Obviously, you must ensure the windowless program is running.
 
  • #14
Routaran said:
Honestly, if you really want a button that you click once, just write a batch script and put it in there.
It's on your gui and you have to click it once just like a button and then it does exactly what you want.
Also the links toolbar works well.
linkstoolbar.jpg
 

1. How do I start creating a GUI on the Windows7 desktop?

To start creating a GUI on the Windows7 desktop, you will need to have a programming language and development environment installed on your computer. Popular options include Java, C#, and Python. Once you have chosen a language, you can use a graphical user interface library or toolkit, such as Swing for Java or Windows Forms for C#, to design and create your GUI.

2. Can I customize the appearance of my GUI on the Windows7 desktop?

Yes, you can customize the appearance of your GUI on the Windows7 desktop by using various properties and methods provided by your chosen programming language and GUI library. This includes changing the color, size, and style of buttons and other components, as well as adding images, icons, and other visual elements to your GUI.

3. How do I add functionality to my GUI on the Windows7 desktop?

You can add functionality to your GUI on the Windows7 desktop by writing code to handle events, such as button clicks or mouse movements, and perform specific actions based on those events. This can include displaying information, performing calculations, or interacting with other programs or files on your computer.

4. Is it possible to incorporate multimedia elements into my GUI on the Windows7 desktop?

Yes, it is possible to incorporate multimedia elements, such as videos, music, or animations, into your GUI on the Windows7 desktop. This can be done by using specific libraries or APIs for multimedia in your chosen programming language, or by embedding multimedia files directly into your GUI design.

5. Can I create a responsive GUI that will work on different screen sizes on the Windows7 desktop?

Yes, you can create a responsive GUI that will work on different screen sizes on the Windows7 desktop by using layout managers and responsive design techniques. These allow your GUI to adjust its size and layout based on the screen resolution and size of the user's computer, ensuring a consistent user experience across different devices.

Similar threads

  • Computing and Technology
Replies
16
Views
5K
  • Computing and Technology
Replies
7
Views
1K
Replies
18
Views
8K
Replies
15
Views
5K
Replies
8
Views
2K
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • Programming and Computer Science
Replies
10
Views
4K
  • Programming and Computer Science
Replies
2
Views
1K
  • Computing and Technology
Replies
8
Views
2K
Back
Top