/*--------------------------------------------------------*\
| COMMAND WINDOW PROCEDURE
\*--------------------------------------------------------*/
-LONG APIENTRY CommandProc(HWND hWnd, UINT wMsg, WPARAM wParam, LONG lParam )
+LRESULT APIENTRY CommandProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam )
{
HWND hWndEdit;
- int index; // Nb of characters in the buffer of hWndEdit
MINMAXINFO* lpmmi;
switch(wMsg)
break;
case WM_SIZE :
+ {
hWndEdit = (HWND)GetWindowLong(hWnd, CLIENTWND);
MoveWindow(hWndEdit, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
- // Place the cursor at the end of the buffer
- index = SendMessage(hWnd, WM_GETTEXTLENGTH, 0l, 0l);
+ // Place the cursor at the end of the buffer
+ // Nb of characters in the buffer of hWndEdit
+ LRESULT index = SendMessage(hWnd, WM_GETTEXTLENGTH, 0l, 0l);
SendMessage(hWnd, EM_SETSEL, index, index);
break;
+ }
case WM_SETFOCUS :
hWndEdit = (HWND)GetWindowLong(hWnd, CLIENTWND);
-LONG APIENTRY EditProc(HWND, UINT, WPARAM, LONG);
+LRESULT APIENTRY EditProc(HWND, UINT, WPARAM, LPARAM);
/*--------------------------------------------------------*\
| COMMAND CREATE PROCEDURE
\*--------------------------------------------------------*/
int again = 1;
char temp[COMMANDSIZE]="";
- int nbLine = SendMessage(hWnd, EM_GETLINECOUNT, 0l, 0l);
+ int nbLine = (int )SendMessage(hWnd, EM_GETLINECOUNT, 0l, 0l);
int nbChar = 0;
buffer[0]='\0';
WORD* nbMaxChar = (WORD*)temp;
*nbMaxChar = COMMANDSIZE-1;
- int nbCharRead = SendMessage(hWnd, EM_GETLINE, nbLine-1, (LPARAM)temp);
+ int nbCharRead = (int )SendMessage(hWnd, EM_GETLINE, nbLine-1, (LPARAM)temp);
nbChar += nbCharRead ;
int cmp = strncmp(temp, PROMPT, 10);
temp[nbCharRead]='\0';
/*--------------------------------------------------------*\
| EDIT WINDOW PROCEDURE
\*--------------------------------------------------------*/
-LONG APIENTRY EditProc(HWND hWnd, UINT wMsg, WPARAM wParam, LONG lParam )
+LRESULT APIENTRY EditProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam )
{
char buffer[COMMANDSIZE];
POINT pos;
BOOL rep;
- static int nbline; // Process the buffer of the edit window
- int index;
-
+ static LRESULT nbline; // Process the buffer of the edit window
+ LRESULT index;
+
switch(wMsg)
{
case WM_CHAR :
/*--------------------------------------------------------*\
| DRAW WINDOW PROCEDURE
\*--------------------------------------------------------*/
-LONG APIENTRY DrawWindow::DrawProc(HWND hWnd, UINT wMsg, WPARAM wParam, LONG lParam )
+LRESULT APIENTRY DrawWindow::DrawProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam )
{
DrawWindow* localObjet = (DrawWindow*)GetWindowLong(hWnd, CLIENTWND);
if (!localObjet)
void DrawWindow::Init(Standard_Integer theXLeft, Standard_Integer theYTop,
Standard_Integer theWidth, Standard_Integer theHeight)
{
- if (win == 0)
+ if (win == NULL)
{
win = CreateDrawWindow(hWndClientMDI, 0);
}
// include decorations in the window dimensions
// to reproduce same behaviour of Xlib window.
- DWORD aWinStyle = GetWindowLongPtr (win, GWL_STYLE);
- DWORD aWinStyleEx = GetWindowLongPtr (win, GWL_EXSTYLE);
+ DWORD aWinStyle = GetWindowLong (win, GWL_STYLE);
+ DWORD aWinStyleEx = GetWindowLong (win, GWL_EXSTYLE);
HMENU aMenu = GetMenu (win);
RECT aRect;
HDC hDC = GetDC(win);
HDC aWorkDC = myUseBuffer ? GetMemDC(hDC) : hDC;
- TextOut(aWorkDC, x, y, text, strlen(text));
+ TextOut(aWorkDC, x, y, text, (int )strlen(text));
if (myUseBuffer) ReleaseMemDC(aWorkDC);
ReleaseDC(win,hDC);
__Draw_API static void SelectNoWait (HANDLE&,int&,int&,int&);
// Procedure de fenetre
- __Draw_API static LONG APIENTRY DrawProc (HWND,UINT,WPARAM,LONG);
+ __Draw_API static LRESULT APIENTRY DrawProc (HWND,UINT,WPARAM,LPARAM);
private:
*/
#include <Windows.h>
-LONG APIENTRY WndProc(HWND, UINT, WPARAM, LONG);
+LRESULT APIENTRY WndProc(HWND, UINT, WPARAM, LPARAM);
BOOL CreateProc(HWND);
VOID DestroyProc(HWND);
BOOL CommandProc(HWND, WPARAM, LPARAM);
|
|
\*--------------------------------------------------------*/
-LONG APIENTRY WndProc(HWND hWndFrame, UINT wMsg, WPARAM wParam, LONG lParam )
+LRESULT APIENTRY WndProc(HWND hWndFrame, UINT wMsg, WPARAM wParam, LPARAM lParam )
{
HWND hWndClient;
switch(wMsg)
for (Standard_Size aCol = 0; aCol < SizeY(); ++aCol)
{
// extremely SLOW but universal (implemented for all supported pixel formats)
- aColor = PixelColor (aCol, aRow, aDummy);
+ aColor = PixelColor ((Standard_Integer )aCol, (Standard_Integer )aRow, aDummy);
aByte = Standard_Byte(aColor.Red() * 255.0); fwrite (&aByte, 1, 1, aFile);
aByte = Standard_Byte(aColor.Green() * 255.0); fwrite (&aByte, 1, 1, aFile);
aByte = Standard_Byte(aColor.Blue() * 255.0); fwrite (&aByte, 1, 1, aFile);
std::cerr << "CheckExtension called with NULL string!\n";
return Standard_False;
}
- int anExtNameLen = strlen (theExtName);
+ const size_t anExtNameLen = strlen (theExtName);
// available since OpenGL 3.0
// and the ONLY way to check extensions with OpenGL 3.1+ core profile
const char* aPtrEnd = aPtrIter + strlen (anExtString);
while (aPtrIter < aPtrEnd)
{
- int n = strcspn (aPtrIter, " ");
+ const size_t n = strcspn (aPtrIter, " ");
if ((n == anExtNameLen) && (strncmp (aPtrIter, theExtName, anExtNameLen) == 0))
{
return Standard_True;
{
for (Standard_Size aCol = 0; aCol < anImage.SizeX(); ++aCol)
{
- aSrcColor = anImageLoaded.PixelColor (aCol, aRow);
+ aSrcColor = anImageLoaded.PixelColor ((Standard_Integer )aCol, (Standard_Integer )aRow);
Image_ColorRGB& aColor = aDataNew.ChangeValue (aRow, aCol);
aColor.r() = int(255.0 * aSrcColor.Red());
aColor.g() = int(255.0 * aSrcColor.Green());
const Quantity_NameOfColor aBackColor
)
{
- LONG uData;
- WINDOWPLACEMENT wp;
-
ZeroMemory (&myExtraData, sizeof (WNT_WindowData));
myHWindow = aHandle;
myHParentWindow = GetParent ((HWND )aHandle);
- uData = GetWindowLongPtr ((HWND )aHandle, GWLP_USERDATA);
+ LONG_PTR uData = GetWindowLongPtr ((HWND )aHandle, GWLP_USERDATA);
myUsrData = Standard_Address(-1);
SetBackground (aBackColor);
myExtraData.WNT_Window_Ptr = (void* )this;
- if (uData != (LONG )&myExtraData)
+ if (uData != (LONG_PTR )&myExtraData)
{
myUsrData = (Standard_Address )SetWindowLongPtr ((HWND )myHWindow, GWLP_USERDATA, (LONG_PTR )&myExtraData);
}
myExtraData.dwFlags = WDF_FOREIGN;
+ WINDOWPLACEMENT wp;
wp.length = sizeof (WINDOWPLACEMENT);
GetWindowPlacement ((HWND )myHWindow, &wp);