Download Pelles C here: http://www.pellesc.se
.386
.model flat,stdcall
option casemap:none
ExitProcess PROTO :DWORD
WriteFileToDisc PROTO :DWORD,:DWORD,:DWORD
.data
fname db 'MsgBox.bin',0
.code
MsgBox:
call delta
delta:
pop edx
mov eax,OFFSET delta
sub edx,eax
lea eax,[edx+capt]
lea ecx,[edx+msg]
; call MessageBox
push 0
push eax
push ecx
push 0
call DWORD PTR [esp+20]
retn 16
capt db 'Hello',0
msg db 'This is a test.',0
start:
ProcLen EQU start-MsgBox
invoke WriteFileToDisc,ADDR fname,\
MsgBox,ProcLen
invoke ExitProcess,0
END start
$APPTYPE GUI
DIM s AS STRING
DIM pMessageBox as INTEGER
DECLARE FUNCTION CallWindowProc LIB "user32" ALIAS "CallWindowProcA" _
(Proc AS LONG, p1 AS LONG, p2 AS LONG, p3 AS LONG, _
p4 AS LONG) AS LONG
DECLARE FUNCTION GetProcAddress LIB "kernel32" ALIAS "GetProcAddress" (hModule AS LONG, lpProcName AS STRING) AS LONG
DECLARE FUNCTION LoadLibrary LIB "kernel32" ALIAS "LoadLibraryA" (lpFileName AS STRING) AS LONG
DefInt ptrMsgBox
FUNCTION MsgBox1(pointer As Long) As Long
Result=CallWindowProc(ptrMsgBox,pointer,0,0,0)
END FUNCTION
$RESOURCE ResourceName AS "MsgBox.bin"
DIM Mem AS QMEMORYSTREAM
Mem.ExtractRes(Resource(0))
Mem.Position=0
s=Mem.ReadBinStr(Mem.Size)
ptrMsgBox=varptr(s)
pMessageBox = GetProcAddress(LoadLibrary("user32.dll"), "MessageBoxA")
MsgBox1(pMessageBox)
RC.EXE -LC:\Rapidq\lib MBox.basQuote from: John Z on March 10, 2024, 04:32:49 PMI applaud your ambition! Other than my experience with Xilinx FPGA, many years ago, it is way way out of my zone. But I look forward to trying it someday.
John Z
Are you limiting your possible collaborators by requiring LinkedIn? I stayed away from it, and especially after it became an arm of Micro$oft...
Page created in 0.022 seconds with 11 queries.