News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Windows Projects

Started by Manos, February 09, 2019, 06:22:42 AM

Previous topic - Next topic

Manos

I upload three simple projects.
To help you, put the files of each project in the bin folder,
as I describe in my post :Using CoderStudio Tools
After build each project, delete its files from the bin folder
and put the files of the other project.

Manos.

Vortex

Thanks for the examples. Here is how to build the dialog box example with a batch file :

\pcc32\bin\pcc32.exe /I\pcc32\include /c Frame.c
\pcc32\bin\rc32.exe /I\pcc32\include Dialog.rc
\pcc32\bin\link32 /LIBPATH:\pcc32\lib /SUBSYSTEM:WINDOWS Frame.obj Dialog.res kernel32.lib user32.lib shell32.lib gdi32.lib comctl32.lib msvcrt.lib


Vortex

Here is a classical window example.

Vortex


Manos

Very good example Vortex.

Note:
With CoderStudio IDE you can mix assembly and C modules.
Soon I 'll upload your project using CoderStudio IDE.

Manos.

Manos

Open with CoderStudio IDE the BmpFromFile.sdp file
and build the project.

Manos.

Vortex

Hi Manos,

Thanks, it works as expected.

TimoVJL

When we see that the pcc32 is able to compile UASM from source  ?
Now, missing headers, hanging,...
May the source be with you

Manos

Quote from: TimoVJL on February 14, 2019, 08:28:04 AM
When we see that the pcc32 is able to compile UASM from source  ?
Now, missing headers, hanging,...

Could you send me the 32 bit source to try it ?

Manos.

TimoVJL

#9
This well known site:
https://github.com/Terraspace/UASM
May the source be with you

Vortex

An example to save the icon of an executable :
#include <windows.h>
#include <olectl.h>

const IID __cdecl IID__IPicture =
    { 0x7BF80980, 0xBF32, 0x101A, { 0x8B, 0xBB, 0x00, 0xAA, 0x00, 0x30, 0x0C, 0xAB } };

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{
PICTDESC pd;
HICON hIcon;
HMODULE hModule;
IPicture *pBitmap;
IStream  *pStream;
LONG pcbSize;
HGLOBAL hGlobal;
LPVOID IconAddr;
HANDLE hFile;
DWORD bWritten;

// load the test executable and the associated icon

hModule = LoadLibrary("Test.exe");
hIcon = LoadIcon(hModule,MAKEINTRESOURCE(100));

// initialize the PICTDESC structure

pd.cbSizeofstruct = sizeof(PICTDESC);
pd.picType = PICTYPE_ICON;
pd.icon.hicon = hIcon;

// create the OLE image

OleCreatePictureIndirect(&pd,&IID__IPicture,TRUE,(void **)&pBitmap);

// create the destination stream to save the icon
                                                   
CreateStreamOnHGlobal(NULL,TRUE,(LPSTREAM *)&pStream);

// save the icon to the stream
                                                   
pBitmap->lpVtbl->SaveAsFile(pBitmap,(LPSTREAM)pStream,TRUE,&pcbSize);

// get the address of the icon in memory

GetHGlobalFromStream(pStream,&hGlobal);
IconAddr = GlobalLock(hGlobal);

// write the icon to disc

hFile= CreateFile("Smiley.ico",GENERIC_WRITE,0,0,
CREATE_ALWAYS,0,0);

WriteFile(hFile,IconAddr,pcbSize,&bWritten,0);

CloseHandle(hFile);

// release the pointers

pBitmap->lpVtbl->Release(pBitmap);
pStream->lpVtbl->Release(pStream);

return 0;
}

Manos

Quote from: TimoVJL on February 14, 2019, 08:28:04 AM
When we see that the pcc32 is able to compile UASM from source  ?
Now, missing headers, hanging,...

Download the Additional Includes and put the new header files
in the include folder.

Manos.

TimoVJL

missing signal.h io.h sys/stat.h
pcc32.exe hangs in equate.c
May the source be with you

Manos

Quote from: TimoVJL on February 17, 2019, 11:27:53 PM
missing signal.h io.h sys/stat.h
pcc32.exe hangs in equate.c

Today I 'll upload an updated include folder.

Manos.

Manos

#14
Quote from: Manos on February 18, 2019, 12:03:18 AM
Quote from: TimoVJL on February 17, 2019, 11:27:53 PMmissing signal.h io.h sys/stat.h
pcc32.exe hangs in equate.c


The include files and the pcc32 are updated to avoid hanging.

Download pcc32 here: pcc32.zip

Manos.