View Full Version : Creating a Front-End for a C:\> App
Pookie
3rd January 2007, 07:57
I've been looking at a bunch of different apps for GUI building - Autoit, Kixstart, Autohotkey, Winbatch - Any recommendations?
I'd like to accomplish the following:
- Choose a folder or an individual file to process
- Choose a destination folder to place the target file(s)
- Be able to choose via check box or drop down box any switches which would normally be typed in at the command line - bitrate, codec, etc.
- Run the command line app with the folder/file variable as input, using whatever boxes have been checked as arguments/switches, creating the output file in whatever folder was chosen.
- Create/compile a standalone .EXE that can work independently of the app that created it.
TIA for suggestions.
buzzqw
3rd January 2007, 08:12
www.purebasic.com , i fall in love with it :)
both mkvmagic and automkv (and Leiming x264 gui, PARanoia, and others) is programmed in PB
BHH
Mr_Odwin
3rd January 2007, 13:09
Or you could try vb.NET - the express editions of Visual Studio are free. With a little tinkering (and googling) you can become reasonably adept at using it in a short time.
LoRd_MuldeR
3rd January 2007, 13:51
I used Delphi to build all my GUI apps (http://mulder.dummwiedeutsch.de/home/?page=projects), so I think you should definitely give it a try. I used Delphi7 Professional, but AFAIK there is a free "Personal Edition" available and there also is Lazarus/FreePascal. If you need some sample code, feel free to ask...
If you want your application to be "stand-alone", then keep away from .NET stuff. It will always require .NET Framework to run, which nobody wants to install, because it slows down your computer like hell ^^
dragongodz
3rd January 2007, 14:40
if you are just going to be making gui's there is no need to buy a commercial program at all. infact for practically any programming there isnt but you can sometimes get extras by doing so.
for example the express visual studio while free doesnt support MFC. so you would need to buy the full version if you wanted that. i think i will wait until i see it in a bargain bin before i bother personally. :)
the borland turbo(free) compilers appear more attractive to me
http://forum.doom9.org/showthread.php?t=115548
what you need to do is work out what sort of language you are going to feel the most comfortable with that will produce the results you want. if you have any previous experience with any then that should be your starting point. if not then you should check out some example code and see how hard you find it. there is examples of most languages floating around the net if you use a bit of searching.
so anyway heres a list of heaps of free compilers for different languages
http://www.thefreecountry.com/compilers/index.shtml
HyperHacker
24th January 2007, 02:22
You can also use MinGW, which is a great free C/C++ compiler for Windows.
cweb
27th January 2007, 14:56
You can also use MinGW, which is a great free C/C++ compiler for Windows.
What do you suggest for the GUI front-end itself with MinGW though? Which library etc...
neuron2
27th January 2007, 15:15
Win32 API.
LoRd_MuldeR
27th January 2007, 15:32
lol, writing a GUI application in pure C/C++ based directly on Win32 API is nearly impossible ;)
Okay, it would be possible. But it would be 1000x more work than using a GUI Toolkit and it would need a deep understanding of Win32 API.
You should at least go for GTK+ or QT4 in this case !!!
neuron2
27th January 2007, 15:49
lol, writing a GUI application in pure C/C++ based directly on Win32 API is nearly impossible ;) Don't be ridiculous. It is easy when you know how and have a little experience. DGPulldown is one simple example that contains the GUI features that the original poster specified. There are lots of other more advanced applications using Win32 as well.
Hyperbole will get you nowhere.
dancho
27th January 2007, 16:39
lol, writing a GUI application in pure C/C++ based directly on Win32 API is nearly impossible
hehe,what a joke...:D
#include <windows.h>
//proto
BOOL CALLBACK Dlg_Func ( HWND , UINT , WPARAM , LPARAM );
int WINAPI WinMain ( HINSTANCE hInst , HINSTANCE hPrevInst , LPSTR lpCmdLine , int iShowCmd ) {
return DialogBox ( hInst , MAKEINTRESOURCE ( DIALOG1 ) , NULL , Dlg_Func ) ;
}
BOOL CALLBACK Dlg_Func ( HWND hWnd , UINT msg , WPARAM wParam , LPARAM lParam ) {
switch (msg){
case WM_INITDIALOG:
return 1;
case WM_COMMAND:
return 1;
case WM_CLOSE:
EndDialog(hWnd,FALSE);
break;
}
return FALSE;
}
This is dialog as main snipet(PelleC),where you can simple add your editboxes,buttons etc...and now you tell me what is nearly imposible in this.
LoRd_MuldeR
27th January 2007, 16:48
Don't be ridiculous. It is easy when you know how and have a little experience. DGPulldown is one simple example that contains the GUI features that the original poster specified. There are lots of other more advanced applications using Win32 as well.
Hyperbole will get you nowhere.
Yes it is possible. Didn't say it is not.
But is a lot of work and it's everything else but intuitive, especially for a beginner!
And for a more complex and large project, it will become too hard to mange all that code, that's for sure.
This means sooner or later you'll have to make your own abstract GUI classes anyway.
So why should anybody go through this pain, when we have GUI libraries and frameworks today?
It's a known fact that the GUI revolution would never have happend without easy-to-use GUI frameworks ;)
Of course you could also write your GUI applicastion in Assembler, but I doubt this makes sens, except you want to learn low-level programming :D
dancho
27th January 2007, 16:57
Of course you could also write your GUI applicastion in Assembler, but I doubt this makes sens, except you want to learn low-level programming
well since I coded MCbatch in Masm32 I know something about low level programming and let me tell you it isnt imposible also,this is dialog as main template from RadASM IDE and if you check it structures you will notes same patter as in my example above...
and after you compile and link it you will get dialogasmain window exe 4 kb big(small)...:D
.386
.model flat,stdcall
option casemap:none
include DialogAsMain.inc
.code
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke GetCommandLine
invoke InitCommonControls
mov CommandLine,eax
invoke WinMain,hInstance,NULL,CommandLine,SW_SHOWDEFAULT
invoke ExitProcess,eax
WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD
LOCAL wc:WNDCLASSEX
LOCAL msg:MSG
mov wc.cbSize,sizeof WNDCLASSEX
mov wc.style,CS_HREDRAW or CS_VREDRAW
mov wc.lpfnWndProc,offset WndProc
mov wc.cbClsExtra,NULL
mov wc.cbWndExtra,DLGWINDOWEXTRA
push hInst
pop wc.hInstance
mov wc.hbrBackground,COLOR_BTNFACE+1
mov wc.lpszMenuName,IDM_MENU
mov wc.lpszClassName,offset ClassName
invoke LoadIcon,NULL,IDI_APPLICATION
mov wc.hIcon,eax
mov wc.hIconSm,eax
invoke LoadCursor,NULL,IDC_ARROW
mov wc.hCursor,eax
invoke RegisterClassEx,addr wc
invoke CreateDialogParam,hInstance,IDD_DIALOG,NULL,addr WndProc,NULL
invoke ShowWindow,hWnd,SW_SHOWNORMAL
invoke UpdateWindow,hWnd
.while TRUE
invoke GetMessage,addr msg,NULL,0,0
.BREAK .if !eax
invoke TranslateMessage,addr msg
invoke DispatchMessage,addr msg
.endw
mov eax,msg.wParam
ret
WinMain endp
WndProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
mov eax,uMsg
.if eax==WM_INITDIALOG
push hWin
pop hWnd
.elseif eax==WM_COMMAND
mov eax,wParam
and eax,0FFFFh
.if eax==IDM_FILE_EXIT
invoke SendMessage,hWin,WM_CLOSE,0,0
.elseif eax==IDM_HELP_ABOUT
invoke ShellAbout,hWin,addr AppName,addr AboutMsg,NULL
.endif
; .elseif eax==WM_SIZE
.elseif eax==WM_CLOSE
invoke DestroyWindow,hWin
.elseif uMsg==WM_DESTROY
invoke PostQuitMessage,NULL
.else
invoke DefWindowProc,hWin,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
WndProc endp
neuron2
27th January 2007, 17:08
Yes it is possible. Didn't say it is not. You said "nearly impossible", which as I pointed out, is a ridiculous claim. You're grossly overstating your case. Win32 is fine for simple GUI apps such as the OP described. One might even argue that a GUI framework is overkill for simple GUIs.
Of course you could also write your GUI application in Assembler, but I doubt this makes sense, except you want to learn low-level programming It's always a good sign that someone's argument is shaky when they have to invent strawmen to shoot down.
LoRd_MuldeR
27th January 2007, 17:33
You said "nearly impossible", which as I pointed out, is a ridiculous claim. You're grossly overstating your case. Win32 is fine for simple GUI apps such as the OP described. One might even argue that a GUI framework is overkill for simple GUIs.
Well, what will you do when you make an application with various dialogs and controls? Are you going to copy-and-past your code for every Control/Dialog over and over again? This would be the ugliest style of programing! Doubling similar code everywhere, which makes it hopeless to bugfix or extend. So what a programmer necessarily will have do is this: Writing abstract GUI classes and use them in your main program wherever need. And this is (more or less) nothing else but writing your own GUI library instead of using an existing one! Of course an interesting task if you want to understand the implementation details. But definitely far away from what a beginner needs, who's just looking for a simple way to put together a GUI application.
neuron2
27th January 2007, 18:20
There you go with your straw men again. The OP wanted a simple dialog with a few check boxes. Win32 API is just fine for that.
I know you're a Delphi fan, but just because you have a hammer, it doesn't mean every problem is a nail.
LoRd_MuldeR
27th January 2007, 18:26
There you go with your straw men again. The OP wanted a simple dialog with a few check boxes.
Extendibility is one major goal in software design :D
And I don't speak about Delphi at all here.
Delphi is only one of many GUI frameworks, although IMHO it is pretty good one for Windows.
If you need a free and cross-platform solution, you can go with GTK+ or QT4 for example.
Then there is AWT/SWING for Java and so on and so on.
Not to speaking about .NET, which seems to become more popular every day...
neuron2
27th January 2007, 18:34
well since I coded MCbatch in Masm32 I know something about low level programming and let me tell you it isnt imposible also For those wanting to play around with this, see here:
http://www.grc.com/smgassembly.htm
You'll learn about assembler and the Win32 API.
dancho
27th January 2007, 18:44
and THE forum for all your Masm32 questions:
http://www.masm32.com/board/index.php
cweb
28th January 2007, 11:33
lol, writing a GUI application in pure C/C++ based directly on Win32 API is nearly impossible ;)
Okay, it would be possible. But it would be 1000x more work than using a GUI Toolkit and it would need a deep understanding of Win32 API.
You should at least go for GTK+ or QT4 in this case !!!
I agree that it is more convenient, for sure.
I know there was a problem with GTK+ concerning MinGW - there's no working build as yet.. (last time I checked a few months ago, not sure if there has been any progress on that front).
cweb
28th January 2007, 11:35
But is a lot of work and it's everything else but intuitive, especially for a beginner!
And for a more complex and large project, it will become too hard to mange all that code, that's for sure.
It also means you will spend a lot of time on the GUI, rather than on your app's code.
LoRd_MuldeR
28th January 2007, 13:40
I know there was a problem with GTK+ concerning MinGW - there's no working build as yet.. (last time I checked a few months ago, not sure if there has been any progress on that front).
What about Avidemux for example? They use GTK+ and have working Win32 build.
No idea whether it was compiled with MinGW or cross-compiled from Linix though...
dragongodz
29th January 2007, 00:29
enough already guys. there has already been atleast one thread on what programming language people can use to do general programming. if you want to start discussing gui libs etc then please start a different thread for it.
the question was with what language could Pookie use to create a standalone program/gui to run a cli program. as i said, he can use practically any language for that.
i wont bother to repeat everything i said in my first post as its there to be read at anytime.
Pookie
29th January 2007, 05:09
No, I appreciate it and I've been checking out the apps mentioned.
housekat
3rd February 2007, 18:52
if the gui is not complex i'd use autohotkey.
i'm right now working on an encoding gui and autohotkey had well done for me (~3000lines but not ready...)
its easy to learn (just in my eyes)
most primtitives like searching in files,opening files are ready made
its complete free
if you really need you can use external dlls
you can compile an exe
theres a big community with lots of examples
just a hint - it depends on your needs.
Ebobtron
3rd February 2007, 23:56
@neuron2,Your win32 suggestion is spot on 100 percent. Plenty of horsepower or a tumb push if you like. Depends on how hard pookie wants to work.
@LoRd_MuldeR, avsFilmCutter is a little more than what pookie wants. It maintains about 70 window handles created by about 80 odd createwindow() functions, although similar they are not the same (I have done a lot of copying and pasting). Large source (13000 lines with 5000 lines with comments), little executable. The above we can debate.
You are wrong about expandable and debug able. That is a programmer issue not a program issue.
Hardest things about bugs are knowing that there is one.
avsFilmCutter is very expandable, good thing because I don't know what I'm doing, very debug able too, again a good thing for the same reason.@pookie,Don't be afraid of the Win32API, I hadn't touched the stuff in eleven years, never used the win32api and had a framework for the GUI in less than a month.
Of course, all this never guarantees a usable program. Good luck with your choice.
Thanks all
Pookie
8th February 2007, 03:02
Thanks again. Some of these apps are so powerful, it's kind of like getting a Porsche to drive to the corner store. :D I think the Autoit/Autohotkey apps might do the trick, plus they support Win32 APIs.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.