NO

Author Topic: Is there any easier abroad to made gui in C?  (Read 3150 times)

Jokaste

  • Guest
Re: Is there any easier abroad to made gui in C?
« Reply #15 on: May 16, 2019, 09:02:45 pm »
I like the Pelles C Compiler, but that's true that the editor could be improved.
I would like to interface Pelles with NotePad++.


But there is no other problem, Perhaps the compiler has bugs but is there ONE program with NO bug.
I would like to remember that Pelles C is FREE and for a free tools it is very good.


Thank You Mr Pelle :D

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1852
Re: Is there any easier abroad to made gui in C?
« Reply #16 on: May 17, 2019, 06:30:02 pm »
Notepad++ have NppExec
May the source be with you

Offline cnoob

  • Member
  • *
  • Posts: 19
Re: Is there any easier abroad to made gui in C?
« Reply #17 on: May 19, 2019, 01:39:50 pm »
I think we should focus on CodeBlocks. It offers full Win32 programming environment like Pelles C, it code editor and code completion is much better and it's possible to add new compiler support without too much hard work. Text editors like Notepad++ only provide word based completion, clearly not what we want to replace Pelles C IDE.

Offline jj2007

  • Member
  • *
  • Posts: 506
Re: Is there any easier abroad to made gui in C?
« Reply #18 on: May 28, 2019, 03:12:45 pm »
code completion is much better

I wonder whether an add-in can intercept keyboard messages, i.e. WM_CHAR and friends. The class of the main editor control is PC_SourceEdit, probably a superclassed edit control.

What I do in my own editor is quite simple:
- user types space
- WM_CHAR handler scans (rich) edit control text backwards until it hits something below "A"
- if the resulting short text, e.g. mb, is found in a text file that contains entries like...
Code: [Select]
mb<TAB>MessageBox(0, "Hello", "Title", MB_OK)... then the text to the right of TAB replaces the mb. That works perfectly, and of course, the user can edit the text file and add whatever is needed for code completion.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1852
Re: Is there any easier abroad to made gui in C?
« Reply #19 on: May 29, 2019, 11:21:41 am »
ucase.c example use subclassing for document window.
poide have a code snippet feature (Ctrl+space).
May the source be with you

Offline jj2007

  • Member
  • *
  • Posts: 506
Re: Is there any easier abroad to made gui in C?
« Reply #20 on: May 29, 2019, 07:14:45 pm »
ucase.c example

..\PellesC\Projects\Samples\Add-Ins\UCase\ucase.c

It builds fine but it doesn't install itself for reasons I don't understand. The file is placed in ..\PellesC\Bin\AddIns\ucase.dll but doesn't show in any of the menus mentioned in Howto install an Add-in 8)
« Last Edit: May 29, 2019, 07:28:29 pm by jj2007 »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1852
Re: Is there any easier abroad to made gui in C?
« Reply #21 on: May 29, 2019, 07:51:06 pm »
It just convert every pressed key to upper case.
May the source be with you

Offline classiccoder85

  • Member
  • *
  • Posts: 1
Re: Is there any easier abroad to made gui in C?
« Reply #22 on: July 30, 2019, 09:50:55 pm »
There are a number of tools that I like to use that make standard windows Gui programming fairly easy.

1) When I begin the project I'll use the "Windows Application" wizard and select the "dialog based program" option.  This will create some initial code including a dialog in the resource editor that I can modify in the dialog editor.

2) I use https://www.codeproject.com/Articles/4948/Message-Cracker-Wizard-for-Win-SDK-Developers to make the window procedure, message cracking macros, and message processing functions.  If I am writing a windows procedure for a dialog based application I'll change HANDLE_MSG to HANDLE_DLGMSG in the generated code.

3) If I want to handle button clicks I'll use the WM_COMMAND message cracker macro
Code: [Select]
HANDLE_DLGMSG(hwndDlg, WM_COMMAND, Main_OnCommand);
and then break out the events in the WM_COMMAND message processing function like so:
Code: [Select]
static VOID Main_OnCommand(HWND hwnd, INT id, HWND hwndCtl, UINT codeNotify)
{
    switch (id)
    {
        case CMD_OPEN:
            CmdOpen_Click(hwnd);
            break;
        case CMD_SAVE:
            CmdSave_Click(hwnd);
            break;
           //etc...

and so:
Code: [Select]
void CmdSave(HWND hwnd)
{
     // TODO: Save code here
}

These tools take a lot of guess work out of GUI coding and were a great help to me when I was just beginning.


Thanks for this reply. I am still new to win32, not new to programming in general, but new to C.

What would you say is the best win32 tutorial?

My main trouble is not knowing which function names are system/win32 defined and which are user defined. I am using the default template from Pelles as you recommended but there is no color highlighting for API calls, etc.

I come from a Go background where their spec is very well documented. Win32 seems nothing like it.