News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Recent posts

#71
The Campus / Re: Help, creating a Malloc fu...
Last post by jj2007 - May 21, 2012, 10:35:59 PM
Quote from: Vortex on May 21, 2012, 04:57:49 PM
Did you try to use C run-time malloc function from msvcrt.dll ?

The problem is that if you only have access to Kernel32, you cannot use the crt stuff...
Raùl, here is a little macro that needs only the kernel:

include \masm32\include\masm32rt.inc
include Malloc.inc

.code
start: call MyTest
inkey "bye"
exit

MyTest proc
LOCAL v1, v2, rc:RECT
  mov ebx, Malloc(1000000)
  invoke lstrcpy, ebx, chr$("Hey, that's more than enough: ")
  print ebx
  lea eax, rc
  sub eax, ebx
  print str$(eax), " bytes for your little proggies", 13, 10
  ret
MyTest endp
end start


Hey, that's more than enough: 1000000 bytes for your little proggies

... and you don't even have to bother freeing it :wink
#72
The Campus / Re: TB_GETBUTTON where addr TB...
Last post by xandaz - May 21, 2012, 08:35:47 PM
    Qw.... that's chinese to me. I'm just writting one app. I was trying to see if i could enumerate the button identifiers of the media player's toolbar so i could write something that'd keep track of whether it's playing, paused, which track, etc.
    I also tryied file mapping but the player always crashes. Thanks qw.
    btw. this was for a rent-a-coder but i think i've had enough trouble for 17 usd max and someone in russia will prolly bid 10usd so nm.
    Thanks again q
#73
The Campus / Re: TB_GETBUTTON where addr TB...
Last post by qWord - May 21, 2012, 08:30:31 PM
Quote from: xandaz on May 21, 2012, 07:58:59 PMIs there a way to allocate memory that would be common to two different processes?
The VirtualAllocEx function allowes to allocate memory in an other process.
However, what about a message based interface for IPC?
#74
I think you should move the posts to the new forums :D
#75
The Campus / TB_GETBUTTON where addr TBB is...
Last post by xandaz - May 21, 2012, 07:58:59 PM
    How do i make it work for another process to access the lpTBBUTTON of TB_GETBUTTON? I created another process and am trying to use another to enumerate the components of a given control in the other process. The TBBUTTON struct that i reffer in the message comes out empty. Is there a way to allocate memory that would be common to two different processes? Thanks in advance.
#76
GoAsm Assembler and Tools / Re: Rebar control (save, resto...
Last post by xandaz - May 21, 2012, 07:55:12 PM
   okies dave. The thing is i think that RB_SIZETORECT doesn't work very well... It should be a simple way to reorganize the rebar bands. Thanks.
#77
The Campus / Re: How to create a hyperlink?
Last post by hfheatherfox07 - May 21, 2012, 07:14:02 PM
I was not able to duplicate that .....I do have some once that you might like ....just change the time on them to make slower or faster
#78
The Soap Box / Re: New Forum
Last post by baltoro - May 21, 2012, 07:13:42 PM
So,...the obvious question,...
Is The OLD MASM Forum going to just die ???
...Or, are we just going to have to get used to being MASM schizophrenics ???
Also,...does this mean no more PORN ALERTS ???
#79
The Campus / Re: bmp viewer wish your optim...
Last post by dedndave - May 21, 2012, 07:01:34 PM
here are a couple files - one is 256-color - the other is 16-color
one causes the program to crash - the other does not display
#80
The Campus / Re: bmp viewer wish your optim...
Last post by dedndave - May 21, 2012, 05:45:06 PM
by general clean-up, i mean better organize the flow of the source
for example, the INC files and the preamble are a bit out of whack   :P
.386
.model flat,stdcall
option casemap:none

Viewer proto :DWORD,:DWORD,:DWORD,:DWORD
;
;
SaveBmp proto

include bmp.inc

.code
start:

then, in bmp.inc...
include variables.inc
pixel_offset struct
;
;

.code

then, in variables.inc...
.data
ClassName db "BmpView",0
;
;
;
lPixel dw 3

include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\gdi32.inc
include \masm32\include\comctl32.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\comdlg32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\comctl32.lib

.data?
hInstance        dd ?

:bg
it's like a jig-saw puzzle with a couple pieces missing

look at some of the example programs to see how they are organized

as for erasing the background, i will tell you a little trick i use   :U

make a child window with no caption or borders for the image to be displayed in
you really only need 3 style flags: WS_CHILD or WS_VISIBLE or WS_CLIPSIBLINGS
when you load an image, size the child window to the same size as the image
when you register the class for the child, use NULL as the brush handle
the background will never be seen
if you have no image, hide the child window
in the child window WndProc, the only messages you have to handle is WM_PAINT and WM_CLOSE
in the WndProc for the main window, you do not have to handle WM_PAINT
so - it's basically moving some code around a little and registering a class   :P
you can also get rid of the code in WM_PAINT that takes the lesser of the image size and the rcPaint size