News:

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

SystemParametersInfo problem

Started by G`HOST, October 28, 2005, 05:32:34 AM

Previous topic - Next topic

G`HOST

hi
a problem in SystemParametersInfo

       
Quote.IF ax==Button1Id
       invoke SystemParametersInfo,SPI_SETDESKWALLPAPER,NULL,ADDR Wall1,\
                                             SPIF_SENDWININICHANGE
        .ENDIF 

This thing works until the "ADDR Wall1" points to the address of the bitmap file.
But if i change it to the address of the resource identifier it does not change the wallpaper.
   
.rc file ==>>
QuoteWall BITMAP DISCARDABLE "wallpaper.bmp"

Help
Thanks

hutch--

Try this.


; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
    include \masm32\include\masm32rt.inc
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

    .data?
      value dd ?

    .data
      pImage db "c:\winnt\bridge.bmp",0

    .code

start:
   
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

    call main

    exit

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

main proc

    invoke SystemParametersInfo,SPI_SETDESKWALLPAPER,NULL,OFFSET pImage,NULL

    ret

main endp

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

end start
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

hutch--

Here is a small working app that does a lot of what you require.

[attachment deleted by admin]
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

G`HOST

Yes the above example works. but my problem is if i change  "  pImage db "c:\winnt\bridge.bmp",0 "
to say something like this  "pImage db "abc",0  " where as "abc" is the nameID of the Bitmap described in the resource file then this thing does not work, do "SystemParameterInfo" only accept the string reffering to the address of the bmp file and not the resource identifier?

hutch--

You need to look at what you are doing here, the API is designed to display a disk file. The help info is this,

Quote
Sets the desktop wallpaper. The pvParam parameter must point to a null-terminated string containing the name of a bitmap file.

Generally Windows is designed to display a disk file where trying to display a resource from an EXE file is not workable as the exe file can be closed and leave Windows with an error. You will note that it also optionally sets the INI file with the bitmap name so that the OS can display it in the normal settings box.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

G`HOST

OOPS Dont know how i missed it.
THANK YOU