Matt I get more 'flash' on my machine than on machines used in 'live' because I don't have a video card and theres more processing needed to redraw the screen. This may be relevant (or not).
I'd guess that MapInfow.exe is using similar API calls to the Windows kernel to control what you see, as you might be trying to use in code. It may or may not have the desired result. Most of my work is in integrated mapping (the reason I keep banging on about COM) and the control of the redraw of screens is a real issue. But then it is in MapX too - and probably most OCXs. (Controlling the cursor appearance while the map is busy processing for instance). I suggested the simpler solution (ie stay out of the API) just because I'm reluctant to write code that opens up cans of worms, though that may be just a measure of inexperience! Re Gavins posting on COM/.NET etc - he's right about MapBasic of course, very limiting but equally it runs like the clappers compared to an integrate mapping app. I'd guess thats why its still attractive although dialogs are a pig to write. The point I was airing is that if MI have re-engineered MI Pro and MapX to share a large proportion of the codebase then they can keep MapBasic AND have a proper object model for Pro - which would be very powerful as a marketing position. You get out of niche programming into the big boys mainstream world without infuriating your user base. But we don't know yet!! Paul Crisp Syntegra Innovation Place Delta Bank Road Newcastle NE11 9DJ Tel 0191 461 4522 Fax 0191 460 1987 -----Original Message----- From: Matt Trigg [mailto:[EMAIL PROTECTED]] Sent: 15 October 2002 12:24 To: CRISP, Paul -Syntegra UK; MapInfo-L Subject: RE: MI-L Mapper Background colour Thanks Paul I do this already, but you get a white "flash" as the window is invalidated and re-drawn. It is this flashing which causes one of my users problems. Matt -----Original Message----- From: CRISP, Paul -Syntegra UK [mailto:[EMAIL PROTECTED]] Sent: 15 October 2002 12:06 To: MapInfo-L Subject: RE: MI-L Mapper Background colour If using the API makes you nervous you can simply add a layer to the map in the required colour with one object which covers all your map (or all the world) - like the OCEAN.TAB you get with MapX - and make sure its at the bottom of the layers stack. No code at all! Paul Crisp Syntegra Innovation Place Delta Bank Road Newcastle NE11 9DJ Tel 0191 461 4522 Fax 0191 460 1987 -----Original Message----- From: Vladimir Lashin [mailto:[EMAIL PROTECTED]] Sent: 15 October 2002 11:59 To: Matt Trigg Cc: MapInfo-L Subject: Re: MI-L Mapper Background colour Hello Matt, Tuesday, October 15, 2002, 2:36:50 PM, you wrote: MT> I am trying to change the background colour of a Mapper Window, so that when MT> it re-draws, it begins with a black background. At the moment, I draw the MT> black background using a layer, but this creates a 'flashing' effect when MT> users pan across the map, which is causing one of my users problems. MT> I can, of course, change the windows environment to achieve this, but then I MT> end up with a black background in all in Word too! I think you cannot do what you wnat using Mapbasic. Perhaps you can do it when you change Window class member using SetClassLong function (API). >From MSDN: ============================================================================ == WM_ERASEBKGND The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting. A window receives this message through its WindowProc function. Remarks The DefWindowProc function erases the background by using the class background brush specified by the hbrBackground member of the WNDCLASS structure. If hbrBackground is NULL, the application should process the WM_ERASEBKGND message and erase the background. //Lashin: You dont need to process this message - just modify Window Class Long ============================================================================ == SetClassLong The SetClassLong function replaces the specified 32-bit (long) value at the specified offset into the extra class memory or the WNDCLASSEX structure for the class to which the specified window belongs. Note This function has been superseded by the SetClassLongPtr function. To write code that is compatible with both 32-bit and 64-bit versions of Windows, use SetClassLongPtr. DWORD SetClassLong( HWND hWnd, // handle to window int nIndex, // index of value to change LONG dwNewLong // new value ); Parameters hWnd [in] Handle to the window and, indirectly, the class to which the window belongs. nIndex [in] Specifies the 32-bit value to replace. To set a 32-bit value in the extra class memory, specify the positive, zero-based byte offset of the value to be set. Valid values are in the range zero through the number of bytes of extra class memory, minus four; for example, if you specified 12 or more bytes of extra class memory, a value of 8 would be an index to the third 32-bit integer. To set any other value from the WNDCLASSEX structure, specify one of the following values. //Lashin: You need modify value of class member at nIndex == GCL_HBRBACKGROUND GCL_HBRBACKGROUND Replaces a handle to the background brush associated with the class. ============================================================================ ========== CreateSolidBrush The CreateSolidBrush function creates a logical brush that has the specified solid color. HBRUSH CreateSolidBrush( COLORREF crColor // brush color value ); Parameters crColor [in] Specifies the color of the brush. To create a COLORREF color value, use the RGB macro. Return Values If the function succeeds, the return value identifies a logical brush. If the function fails, the return value is NULL. MT> I guess I need to make an API call. I have been playing with SendMessage (in MT> user32.dll) but I cannot find the message ID required to change a window's MT> background. MT> Any ideas? MT> Matt -- Best regards, Vladimir Lashin microOLAP Technologies LLC ---------------------------------------------------------------------------- --------------------------- MBBuilder - Visual Development Tool for MapBasic - http://www.microolap.com/products/gis/mbbuilder.htm Raster Handler for ERDAS Imagine to MapInfo - http://www.microolap.com/products/gis/imgrhl.htm MapInfo Callbacks Manager ActiveX - http://www.microolap.com/products/gis/micmx.htm EasyMap VCL - http://www.microolap.com/products/gis/easymap.htm ---------------------------------------------------------------------------- --------------------------- mailto:[EMAIL PROTECTED] http://www.microolap.com/gis/ - GIS related products --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 3573 ******************************************************************** This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.syntegra.com ******************************************************************** ---------------------------------------------------------------------------- ---------- 1. This message and any files or other attachments transmitted with it is intended for the addressee only. They are private and confidential and are for the sole use of the intended recipient. Copyright in this message and any accompanying document created by us is owned by us. If you are not the intended recipient of this e-mail or any part of it please telephone Head Office at the number shown below or notify us by e-mail at: [EMAIL PROTECTED] You should not use or disclose to any other person the contents of this message or its attachments or files (if any), nor take copies. 2. We have taken every reasonable precaution to ensure that any attachment to this e-mail has been swept for viruses, but we cannot accept any liability for any loss or damage sustained as a result of software viruses and would advise that you carry out your own virus checks before opening any attachment or file. Please note as well that e-mails can be falsified: in circumstances where the content of this e-mail is important you should not rely on its integrity without checking it by telephone or fax. 3. This message and any files or attachments have been sent to you with the sender's knowledge that the contents may be intercepted, monitored and regulated by us in the course of transmission and in compliance with the Regulation of Investigatory Powers Act 2000. If you reply to this message and/or send a message to us in any other way you accept that the contents, including attachments or files, of that message may be intercepted, monitored and regulated by us in the course of transmission and in compliance with the Regulation of Investigatory Powers Act 2000. If for any reason you do not wish to consent to the above please contact us on the number below. GEOGRAPHERS' A-Z MAP COMPANY LIMITED Fairfield Road Borough Green Sevenoaks Kent TN15 8PP Telephone: 01732 781000 Fax: 01732 780677 ---------------------------------------------------------------------------- ---------- ******************************************************************** This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.syntegra.com ********************************************************************
