Hi,
I tried to use Winapi floodfill function with an Access Form. Here is the
code in a click-button sub :
Dim hDC As Long
Dim hBrush As Long
Dim hobj As Long
Dim ret As Long
hDC = GetDC(Me.hwnd)
hBrush = CreateSolidBrush(65280)
hobj = SelectObject(hDC, hBrush)
ret = FloodFill(hDC, 50, 50, 0)
ret = GetLastError()
ret = DeleteObject(hBrush)
ret = ReleaseDC(hwnd, hDC)
When I click the button, the sub executes but nothing happens. I got the
same result using Winapi fillrect function.
What's wrong? 5 4163
On Feb 19, 6:19 pm, "Michel" <michelpara...@yahoo.cawrote:
Hi,
I tried to use Winapi floodfill function with an Access Form. Here is the
code in a click-button sub :
Dim hDC As Long
Dim hBrush As Long
Dim hobj As Long
Dim ret As Long
hDC = GetDC(Me.hwnd)
hBrush = CreateSolidBrush(65280)
hobj = SelectObject(hDC, hBrush)
ret = FloodFill(hDC, 50, 50, 0)
ret = GetLastError()
ret = DeleteObject(hBrush)
ret = ReleaseDC(hwnd, hDC)
When I click the button, the sub executes but nothing happens. I got the
same result using Winapi fillrect function.
What's wrong?
I see you included GetLastError().
Did you check the result and see what (if any) the last error was?
It may give you a hint.
No hint at all: it's zero. And return code from floodfill is zero too, which
means "failure".
"storrboy" <st******@sympatico.caa écrit dans le message de news: 11**********************@v33g2000cwv.googlegroups. com...
On Feb 19, 6:19 pm, "Michel" <michelpara...@yahoo.cawrote:
Hi,
I tried to use Winapi floodfill function with an Access Form. Here is
the
code in a click-button sub :
Dim hDC As Long
Dim hBrush As Long
Dim hobj As Long
Dim ret As Long
hDC = GetDC(Me.hwnd)
hBrush = CreateSolidBrush(65280)
hobj = SelectObject(hDC, hBrush)
ret = FloodFill(hDC, 50, 50, 0)
ret = GetLastError()
ret = DeleteObject(hBrush)
ret = ReleaseDC(hwnd, hDC)
When I click the button, the sub executes but nothing happens. I got the
same result using Winapi fillrect function.
What's wrong?
I see you included GetLastError().
Did you check the result and see what (if any) the last error was?
It may give you a hint.
No hint at all: it's zero. And return code from floodfill is zero too, which
means "failure".
"storrboy" <st******@sympatico.caa écrit dans le message de news: 11**********************@v33g2000cwv.googlegroups. com...
On Feb 19, 6:19 pm, "Michel" <michelpara...@yahoo.cawrote:
Hi,
I tried to use Winapi floodfill function with an Access Form. Here is
the
code in a click-button sub :
Dim hDC As Long
Dim hBrush As Long
Dim hobj As Long
Dim ret As Long
hDC = GetDC(Me.hwnd)
hBrush = CreateSolidBrush(65280)
hobj = SelectObject(hDC, hBrush)
ret = FloodFill(hDC, 50, 50, 0)
ret = GetLastError()
ret = DeleteObject(hBrush)
ret = ReleaseDC(hwnd, hDC)
When I click the button, the sub executes but nothing happens. I got the
same result using Winapi fillrect function.
What's wrong?
I see you included GetLastError().
Did you check the result and see what (if any) the last error was?
It may give you a hint.
On Feb 21, 12:00 am, "Lise France" <lise.fra...@videotron.cawrote:
No hint at all: it's zero. And return code from floodfill is zero too, which
means "failure".
"storrboy" <storr...@sympatico.caa écrit dans le message de news:
1171941364.149701.305...@v33g2000cwv.googlegroups. com...
On Feb 19, 6:19 pm, "Michel" <michelpara...@yahoo.cawrote:
Hi,
I tried to use Winapi floodfill function with an Access Form. Here is
the
code in a click-button sub :
Dim hDC As Long
Dim hBrush As Long
Dim hobj As Long
Dim ret As Long
hDC = GetDC(Me.hwnd)
hBrush = CreateSolidBrush(65280)
hobj = SelectObject(hDC, hBrush)
ret = FloodFill(hDC, 50, 50, 0)
ret = GetLastError()
ret = DeleteObject(hBrush)
ret = ReleaseDC(hwnd, hDC)
When I click the button, the sub executes but nothing happens. I got the
same result using Winapi fillrect function.
What's wrong?
I see you included GetLastError().
Did you check the result and see what (if any) the last error was?
It may give you a hint.
Found this article on the Access Web and it probably applies to
filling regions. http://www.mvps.org/access/api/api0053.htm
It's not possible to properly draw and repaint on an Access form without
subclassing. Instead, create a bitmap at runtime containing the desired
rendering and set this as the Picture prop of the form. See: http://www.lebans.com/gradientfill.htm
If you want to color the MDI window background see: http://www.lebans.com/changemdibackground.htm
--
HTH
Stephen Lebans http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Michel" <mi***********@yahoo.cawrote in message
news:vk*******************@wagner.videotron.net...
Hi,
I tried to use Winapi floodfill function with an Access Form. Here is the
code in a click-button sub :
Dim hDC As Long
Dim hBrush As Long
Dim hobj As Long
Dim ret As Long
hDC = GetDC(Me.hwnd)
hBrush = CreateSolidBrush(65280)
hobj = SelectObject(hDC, hBrush)
ret = FloodFill(hDC, 50, 50, 0)
ret = GetLastError()
ret = DeleteObject(hBrush)
ret = ReleaseDC(hwnd, hDC)
When I click the button, the sub executes but nothing happens. I got the
same result using Winapi fillrect function.
What's wrong?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: sayoyo |
last post by:
Hi,
Are there any WINAPI or C/C++ functions which allow user to know if a
file is using by another application???
Thanks you very much
sayoyo
|
by: MuZZy |
last post by:
HI,
I would really appreciate some hwlp with this:
Here is the WinAPI struct used in call to winapi function wavInGetDevCaps:
typedef struct
{
WORD wMid;
WORD wPid;
MMVERSION...
|
by: Patrick Blackman |
last post by:
Need example of using WinAPI "CreateWindowEx" in c# any help would be
appreciated.
|
by: Charles Denny |
last post by:
I'm trying to call CertFindCertificateInStore to find all certificates in the
store that have the Code Signing enhanced key usage. I'm running into
problems marshalling the array of OIDs in...
|
by: ian |
last post by:
Hi, I keep resorting to com interop calls, for example I needed the
location of the carot in a text box and I had to use a win32API call
(GetCarotPos??) to do that.
It's one example, I could give...
| |
by: TBoon |
last post by:
How do i read and write ini file using vb.net?
|
by: RhavoX |
last post by:
Hi. This may be a very stupid question but I'll leave you to judge
it ;) I know there were lots of questions about this but none of the
answers suits me.
I'm wondering how to get the BINARY type...
|
by: Angus |
last post by:
I am working with a C API which often requires a char* or char buffer. If a
C function returns a char* I can't use string? Or can I? I realise I can
pass a char* using c_str() but what about...
|
by: tw |
last post by:
Could someone explain me how to get signal from microphone to program in
winapi, (than i want put tone into it) and send to speakers?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |