News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Recent posts

#91
Beginner questions / Re: Createwindow
Last post by John Z - October 31, 2025, 09:50:00 AM
Hi DonnyDave,

Quote from: DonnyDave on October 30, 2025, 03:06:04 PMCOMBOBOX, LISTBOX and DROPDOWNLISTBOX as well.

Your request is too broad for a specific answer.  You can get a start by using Pelle resource IDE to create the list type you want.  Then you use SendMessage to interact with the control.

For an offline help download controls.chm from here:
https://sourceforge.net/projects/windows-controls-api-docs/

Go to the "Control Library" section from there you will see Listbox, and ComboBox entries which show functions, macros, messages etc to use to interact with the control.

Otherwise if you post small examples of where you are 'stuck' doing something, a more focused help would probably be provided.

John Z
#93
Beginner questions / Re: Createwindow
Last post by DonnyDave - October 30, 2025, 03:06:04 PM
COMBOBOX, LISTBOX and DROPDOWNLISTBOX as well.
#94
Beginner questions / Re: Createwindow
Last post by TimoVJL - October 30, 2025, 02:32:15 PM
#95
Feature requests / Re: RichEdit 4.1
Last post by TimoVJL - October 30, 2025, 01:16:15 PM
Sure we can.

Also make just a ref
#pragma comment(lib, "msftedit.lib")
int CALLBACK REExtendedRegisterClass(void *p);

FARPROC pDllGetVersion = (FARPROC)REExtendedRegisterClass;

msftedit.def for x86
LIBRARY msftedit.dll
EXPORTS
_IID_IRichEditOle DATA
_IID_IRichEditOleCallback DATA
_IID_ITextServices DATA
_IID_ITextHost DATA
_IID_ITextHost2 DATA
_CreateTextServices@12
_REExtendedRegisterClass@0
_RichEditANSIWndProc@16
_RichEdit10ANSIWndProc@16
_SetCustomTextOutHandlerEx
_DllGetVersion@4
_RichEditWndProc@16
_RichListBoxWndProc@16
_RichComboBoxWndProc@16

msftedit.def for x64
LIBRARY MSFTEDIT.dll
EXPORTS
IID_IRichEditOle DATA
IID_IRichEditOleCallback DATA
IID_ITextServices DATA
IID_ITextHost DATA
IID_ITextHost2 DATA
CreateTextServices
REExtendedRegisterClass
RichEditANSIWndProc
RichEdit10ANSIWndProc
SetCustomTextOutHandlerEx
DllGetVersion
RichEditWndProc
RichListBoxWndProc
RichComboBoxWndProc
#96
Beginner questions / Createwindow
Last post by DonnyDave - October 30, 2025, 01:14:18 PM
 
 
I'm not understanding how to create a "dropdown listbox" window.
I've searched lots of Microsoft pages, but still can't find the answers.

     hwndStringSize = CreateWindow
        (
          TEXT ("LISTBOX"),
          NULL,
          WS_CHILDWINDOW | WS_VISIBLE,
          x, y,             //  Position
          width, height,    //  width, height,
          hwnd,
          (HMENU)LB_ADDSTRING,
          ghInstance,
          NULL
        );

How do I specify a "dropdown" box ?
How do I setup the initial values ? (say 1,2,3,4, ..etc)
How do I notify the mother window of a mouse click ? ("case LB_ADDSTRING :" not working)
How do I find out what the user selected in the listbox ?

Any help would be much appreciated.

 Dave
#97
Feature requests / Re: RichEdit 4.1
Last post by Vortex - October 30, 2025, 11:43:41 AM
Hi Timo,

We can create an import library for this dll. The Masm64 and Msys2 setups are providing the library.
#98
Feature requests / Re: RichEdit 4.1
Last post by TimoVJL - October 30, 2025, 08:24:08 AM
Meanwhile:
It is possible to add richedit 4.1 to dialog via custom control or add richedit control and change classname to "RichEdit50W"
and LoadLibrary("Msftedit.dll");
#99
Feature requests / RichEdit 4.1
Last post by John Z - October 29, 2025, 02:45:46 PM
Please consider adding Richedit4.1 to the control tool box in a future version release.
It uses the newer RTF DLL Msftedit.dll.

Calling syntax:
    HWND hwndEdit= CreateWindowEx(0, MSFTEDIT_CLASS, TEXT("Type here"),
        ES_MULTILINE | WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP,
        x, y, width, height,
        hwndOwner, NULL, hinst, NULL);

John Z
#100
Assembly discussions / Masking passwords
Last post by Vortex - October 28, 2025, 08:25:32 PM
Here is a dialog box example with an edit control hiding the text in the client area. Exiting the application, a message box displays the text entered to the edit control.

include     HiddenPasswd.inc

IDC_EDIT    equ 4001
PWD_CHAR    equ 43 ; ASCII(*)=42
BUFF_SIZE   equ 64

.data

DlgBox db 'DLGBOX',0
capt   db 'Hidden text',0

.data?

hEdit  dd ?
buffer db BUFF_SIZE dup(?)

.code

start:

    invoke  GetModuleHandle,0
    xor     ecx,ecx
    invoke  DialogBoxParam,eax,\
            ADDR DlgBox,ecx,ADDR DlgProc,ecx
    invoke  ExitProcess,eax

DlgProc PROC hWnd:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD

    .IF uMsg==WM_INITDIALOG

        invoke  GetDlgItem,hWnd,IDC_EDIT
        mov     hEdit,eax
        invoke  SendMessage,eax,EM_SETPASSWORDCHAR,PWD_CHAR,0

    .ELSEIF uMsg==WM_CLOSE

        invoke  GetWindowText,hEdit,ADDR buffer,BUFF_SIZE
        xor     ecx,ecx
        invoke  MessageBox,ecx,ADDR buffer,ADDR capt,ecx
        invoke  EndDialog,hWnd,0

    .ELSE

        xor     eax,eax
        ret

    .ENDIF

    mov     eax,TRUE
    ret

DlgProc ENDP

END start