Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Marquee progress Bar that don't work correctly!
Message
From
18/03/2010 05:16:30
Emanuele Bonin
EB Soluzioni Informatiche
Tezze S/B, Italy
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Marquee progress Bar that don't work correctly!
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Application:
Desktop
Miscellaneous
Thread ID:
01455304
Message ID:
01455304
Views:
131
Hi, All

I've develop a DLL with somu utility functions to use with my VFP programs.
The last one is a function that, in my hope, show an indipendent window with a Fake-ProgressBar MARQUEE typed.

My operations in the DLL are:
1) I register (function RegisterClassMarquee) a window class named "SIMPLEBAR" that use a WindowProcedure ("MarqueeWndProc")
2) In the WM_CREATE message i create a Progress Bar With MARQUEE Style

from VFP:
1) I declare the dll function StartMarquee(HWND nHwnd) and i call It
2) the window appear ... without progress bar ... but if i move the windiow progress bar appear ... freezed ... the squares in the control don't moves ... but if i move the window putting the progress bar poutside the screen and returning it in the screen i see that progress bar has progressed 8))) ...

The question is: Why my progress bar don't move normally, without forcing the rwfresh of the window ? If I create the progress Bar directly in a VFP window the progress bar do it's work.

Can Anyone help me ?

Thanx in Advance

PS: Sorry for my hugly english.




HANDLE RegisterClassMarquee(HINSTANCE hDLLInst)
{
WNDCLASS wc;

// Register the main window class.
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC) MarqueeWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hDLLInst;
wc.hIcon = NULL;
wc.hCursor = NULL;
wc.hbrBackground = GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = "MainMenu";
wc.lpszClassName = "SIMPLEBAR";



RegisterClass(&wc);

}

LRESULT CALLBACK MarqueeWndProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter
LPARAM lParam) // second message parameter
{

switch (uMsg)
{
case WM_CREATE:
LONG style;
HWND hwndMQ2 = CreateWindowEx(0, PROGRESS_CLASS, (LPTSTR) NULL, WS_CHILD | WS_VISIBLE,
30, 30, 100, 20,
hwnd, (HMENU) 0, NULL, NULL);

style = GetWindowLong(hwndMQ2,GWL_STYLE);

SetWindowLongPtr(hwndMQ2,GWL_STYLE, style|PBM_SETMARQUEE);

SendMessage(hwndMQ2, (UINT)PBM_SETMARQUEE, (WPARAM)TRUE, (LPARAM)100);
return 0;

cae WM_PAINT:
return 0;


case WM_SIZE:
return 0;

case WM_DESTROY:
return 0;

default:
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
return 0;
}

DLLIMPORT HWND StartMarquee(HWND nHwnd)
{
LONG style;
HWND hwndMQ;

hwndMQ = CreateWindow(
"SIMPLEBAR", // name of window class
"Sample", // title-bar string
WS_OVERLAPPED|WS_VISIBLE, // top-level window
CW_USEDEFAULT, // default horizontal position
CW_USEDEFAULT, // default vertical position
CW_USEDEFAULT, // default width
CW_USEDEFAULT, // default height
(HWND) nHwnd,
(HMENU) NULL, // use class menu
hPublicDLLInst, // handle to application instance
(LPVOID) NULL); // no window-creation data

return hwndMQ;
}
bye, Emanuele!
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.
Next
Reply
Map
View

Click here to load this message in the networking platform