Newby needs help w/ 2 questions

Hi,
this is my first post on this board... I'm quite new on WinAPI and I have some questions.

1. How can I run another .exe file from my program WITHOUT the system() func? This creates an ugly console win. I wanna run the prog directly.

2. How can I use a bitmap with transparent areas (ya know, these #ffff00 ones) WITHOUT MS Visual C(++)??? All the examples I've seen are using the CreateRgnFromFile() func which isn't part of the standart windows funcs ;-(

Uhm. Forgot some. Nevermind, I'd be awfully happy if any of you could help me with this stuff (mainly the first one). Thxalot!!!

snikkerz

Comments

  • : 1. How can I run another .exe file from my program WITHOUT the system() func? This creates an ugly console win. I wanna run the prog directly.

    Use CreateProcess() func.:

    BOOL CreateProcess(
    LPCTSTR lpApplicationName, // name of executable module
    LPTSTR lpCommandLine, // command line string
    LPSECURITY_ATTRIBUTES lpProcessAttributes,
    LPSECURITY_ATTRIBUTES lpThreadAttributes,
    BOOL bInheritHandles, // handle inheritance flag
    DWORD dwCreationFlags, // creation flags
    LPVOID lpEnvironment, // new environment block
    LPCTSTR lpCurrentDirectory, // current directory name
    LPSTARTUPINFO lpStartupInfo,
    LPPROCESS_INFORMATION lpProcessInformation
    );

    In the MSDN SDK, you can find the detailed explanation of the parameters.

    Also, there's an obsolete function, but provided for compatibiliti reasons, and simpler. (but, in fact it calls this same function above)

    UINT WinExec(
    LPCSTR lpCmdLine, // address of command line
    UINT uCmdShow // window style for new application
    );


    :
    : 2. How can I use a bitmap with transparent areas (ya know, these #ffff00 ones) WITHOUT MS Visual C(++)??? All the examples I've seen are using the CreateRgnFromFile() func which isn't part of the standart windows funcs ;-(

    What do you mean by that? without C++? If you are programming in VC++, than you must use VC++...
    If you mean without external functions, than just lookup the filestructure of the BMP files /really easy/, load the file to memory, than display only the pixels you need. for example, you have a bitmap already loaded, than mix this transparent one with that in memory, and when ready, display it. /because if you do the mixing on-screen, it will be viewable, because GDI isn't the fastest thing in the world/ (unless you have a P6-3.5GHz)
    If you are using directX, than simply determine the transparent color value, and set the mask registers.
    Also, if you want it fast, but no directX thanks, use assembly for the mixing.
    No more ideas....

    Edocecrous
    [system/game programmer]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion