Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
loadstatus.cpp File Reference
#include <os2.h>
#include <string.h>

Go to the source code of this file.

Defines

#define INCL_WIN
#define INCL_GPI

Functions

HWND ShowLoadStatus (char *aMessage)
void DestroyLoadStatus (HWND ahWnd)

Variables

HMODULE hInst
static char szClassName [] = "LoadStatusWindowClass"

Define Documentation

Definition at line 39 of file loadstatus.cpp.

Definition at line 38 of file loadstatus.cpp.


Function Documentation

Definition at line 79 of file loadstatus.cpp.

{
  if (ahWnd)
    WinDestroyWindow(ahWnd);

}

Here is the caller graph for this function:

HWND ShowLoadStatus ( char *  aMessage)

Definition at line 46 of file loadstatus.cpp.

{
  if (!aMessage)
    return NULL;

  if (!WinRegisterClass((HAB)0, szClassName, (PFNWP)WinDefWindowProc, 0, sizeof(ULONG))) {
    return NULL;
  }
  
  HWND hWnd = WinCreateWindow(HWND_DESKTOP, szClassName, "", WS_VISIBLE | WS_DISABLED, 
                              0, 0, 0, 0, HWND_DESKTOP, HWND_TOP, 255, (PVOID)NULL, NULL);
  if (!hWnd) {
    ERRORID error = WinGetLastError(0);
    return NULL;
  }
  
  HPS hPS = WinGetPS(hWnd);
  if (!hPS) {
    WinDestroyWindow(hWnd);
    return NULL;
  }

  POINTL ptls;
  GpiQueryTextBox(hPS, strlen(aMessage), aMessage, 1, &ptls);
  WinSetWindowPos(hWnd, HWND_TOP, 0, 0, ptls.x + 4, ptls.y + 2, SWP_SHOW );
  POINTL ptlStart;
  ptlStart.x = 2; ptlStart.y = 1;
  GpiCharStringAt(hPS, &ptlStart, strlen(aMessage), aMessage);
  WinReleasePS(hPS);

  return hWnd;
}

Here is the caller graph for this function:


Variable Documentation

HMODULE hInst

Definition at line 65 of file main.cpp.

char szClassName[] = "LoadStatusWindowClass" [static]

Definition at line 44 of file loadstatus.cpp.