⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wpw_wapi_lf_95.html

📁 VC programing
💻 HTML
📖 第 1 页 / 共 3 页
字号:
jgkelly@freenet.grfn.org (Jeff Kelly) writes:

>Does anyone out there know what the MS linker does when one specifies the 
>output version to be Windows 4? (I forgot what the linker switch was)  
>And if that switch is duplicated in BC++4.x's linker?  

>I'm attempting to get the Win95 3-D look without running Ctl3D (since OWL 
>disables it when it is running under Win95), and be able to use the new 
>common controls.  

>Please let me know if there is a way around this without buying VC++ or 
>waiting for the next version of BC++.

All there is to the 95 3D look is a new dialog style, #define'd as 
DS_3DLOOK in the Winodows 95 SDK headers.  It's value is 0x4 (which
is just a coincidence with "version 4.0").  Just add this style bit
to you dialog template and, viola!, 3D dialogs.  This works for any
dialog window, regardless of whether it was created by a Win32 or a
Win16 app.  You don't need a new compiler, just a style bit.

To use the new common controls, you will need the Windows 95 SDK.  For
this, you must either be on the 95 beta or a Level II member of the
Microsoft Developer's Network.

-------------------------------------------------------------------------
Matt Arnold                       |        | ||| | |||| |  | | || ||
marnold@netcom.com                |        | ||| | |||| |  | | || ||
Boston, MA                        |      0 | ||| | |||| |  | | || ||
617.389.7384 (h) 617.576.2760 (w) |        | ||| | |||| |  | | || ||
Windows C++ developer             |        | ||| 4 3 1   0 8 3 || ||
-------------------------------------------------------------------------

</PRE>



<HR><A NAME=WINAPI_SET_TEXT_VT100>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br> 
<H4>Subject: Setting Text in Windows like vt100</H4><PRE>
In article <3s32bt$ia2@cville-srv.wam.umd.edu>,
   snakey@exp2.wam.umd.edu (David R.) wrote:
>     I'm just starting to work with Windows programming and I'm creating a 
>program which I'd like to be able to output vt100 text to a window.
>The best way to do this I have found is to keep track of the screen in
>a character array.  Each time a new character or vt100 command is read in,
>the array is updated and copied to the window via the SetWindowText call.
>This seems to be very inefficient though, and I was wondering if there is
>another way to do this.  I'd like to just be able to have an 80x25 array 
that
>I can write ascii values to, and have the text window automatically pick
>this array up and display it in the window.  Well, I'd settle for any advice
>that anyone can give me which would help me make my source code more 
efficient.
>I'd be VERY interested in seeing any source code that any of you have, if it
>relates to this.  Ie: If you have some C or C++ source code for a telnet 
>program or communications program, I'd really appreciate it if you could 
>forward me a copy.  Thanks a billion!

I've been working on this same problem myself.  I haven't had time to try it 
yet, but I had the idea of keeping two 80x25 buffers.  The first keeps an 
image of what the screen looks like, and the second is for updating.  
Periodicaly, the updated buffer would be compared to the image buffer, and 
only the differences would be repainted.  After repainting, the image buffer 
would be updated.  There would have to be some refinements -- scrolling 
should scroll the window, rather than repainting the whole thing.

I've given up on the idea of using a text control.  It's too slow and 
limited.  I'm just painting text on the window myself.

      /
  /  *  /  Alan Hamilton
 *     *   alanh@primenet.com
<HR>
Alan Hamilton (alanh@primenet.com) wrote:
: In article <3s32bt$ia2@cville-srv.wam.umd.edu>,
:    snakey@exp2.wam.umd.edu (David R.) wrote:
: >     I'm just starting to work with Windows programming and I'm creating a 
: >program which I'd like to be able to output vt100 text to a window.
: >The best way to do this I have found is to keep track of the screen in
: >a character array.  Each time a new character or vt100 command is read in,
: >the array is updated and copied to the window via the SetWindowText call.
: >This seems to be very inefficient though, and I was wondering if there is
: >another way to do this.  I'd like to just be able to have an 80x25 array 
: that
: >I can write ascii values to, and have the text window automatically pick
: >this array up and display it in the window.  Well, I'd settle for any advice
: >that anyone can give me which would help me make my source code more 
: efficient.
: >I'd be VERY interested in seeing any source code that any of you have, if it
: >relates to this.  Ie: If you have some C or C++ source code for a telnet 
: >program or communications program, I'd really appreciate it if you could 
: >forward me a copy.  Thanks a billion!

: I've been working on this same problem myself.  I haven't had time to try it 
: yet, but I had the idea of keeping two 80x25 buffers.  The first keeps an 
: image of what the screen looks like, and the second is for updating.  
: Periodicaly, the updated buffer would be compared to the image buffer, and 
: only the differences would be repainted.  After repainting, the image buffer 
: would be updated.  There would have to be some refinements -- scrolling 
: should scroll the window, rather than repainting the whole thing.

Since there doesn't seem to be any hardware scroll feature that is used by
a Window function to "scroll" an image, all "scrolling" is done via a repaint.
If there were a "scroll" function, I suspect it would just hid a repaint
from you.  The wouldn't be any real difference in you doing and the system
doing it.

: I've given up on the idea of using a text control.  It's too slow and 
: limited.  I'm just painting text on the window myself.


Me too.  Works fine.  I'm still having problems with scrollbars , though.

:       /
:   /  *  /  Alan Hamilton
:  *     *   alanh@primenet.com

-- 
------------------------------------------------------------------------
Jim Lynch, Sales Analyst,  Cray Research, Inc. / ARS: K4GVO
Southeast District, Phone: (404) 631-2254, Email: jwl@cray.com
Suite 270, 200 Westpark Drive, Peachtree City, GA 30269

</PRE>


<HR><A NAME=WINAPI_SET_MINMAX>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br> 
<H4>Subject: Setting Windows Min Max info</H4><PRE>
In MFC I use

void CMyWnd::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
        // Set to min 320x200
        CPoint pt(320, 200);
        lpMMI->ptMinTrackSize = pt;
        CWnd::OnGetMinMaxInfo(lpMMI);
}

so in windows use WM_GETMINMAXINFO

Andy.
<HR>
Kevin Autrey (exukev@exu.ericsson.se) wrote:
: I'm trying to set up the maximum and minimum width/height of my app's
: main window.

: I can't figure out how to do this - I've looked at
: SetWindowPlacement(), but it didn't seem to be able to do what I was
: trying to do.

: I basically want Windows to know that it can't stretch/shrink the
: border of the window past a certain point so the user won't get
: his/her hopes all up that they can get this little/giant window and
: then be crushed when I just redraw it to its actual minimum size
: (which is much larger than what they so doe-eyed specified it to be).

: All help appreciated,
: Kevin

: __
: \/ Kevin Autrey | exukev@exu.ericsson.se | Ericsson Inc.
:                 |                        | Richardson, TX

--
Intercept WM_WINDOWPOSCHANGING, and change the cx/cy of the lparam to be 
what you want if they are too small/to big.
jason



   Jason McMunn                                      HOME: 208-885-8756
   Get Real Software                                 
   Pacific Simulation                                
  mcmun911@uidaho.edu    mcmun921@cs.uidaho.edu   jason@unix.digital-cafe.com
------------------------------------------------------------------------------
      I speak for no person or organization other than myself.
------------------------------------------------------------------------------

<HR>
In article <3s718g$sur@cnn.exu.ericsson.se>
           exukev@exu.ericsson.se "Kevin Autrey" writes:

>I'm trying to set up the maximum and minimum width/height of my app's
>main window.
>
>I can't figure out how to do this - I've looked at
>SetWindowPlacement(), but it didn't seem to be able to do what I was
>trying to do.
>
>I basically want Windows to know that it can't stretch/shrink the
>border of the window past a certain point so the user won't get
>his/her hopes all up that they can get this little/giant window and
>then be crushed when I just redraw it to its actual minimum size
>(which is much larger than what they so doe-eyed specified it to be).

You need to process the "WM_GETMINMAXINFO" message.

Chris
-- 
--------------------------------------------------------------------------
| Chris Marriott, Warrington, UK      | Author of SkyMap v2 shareware    |
| chris@chrism.demon.co.uk            | astronomy program for Windows.   |
|      For more info, see http://www.winternet.com/~jasc/skymap.html     |
|      Author member of Association of Shareware Professionals (ASP)     |
--------------------------------------------------------------------------
 
</PRE>

<HR><A NAME=WINAPI_Hide_Windows>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br> 
<H4>Subject: Create Daemon Application</H4><PRE>
Wilson> I am new to windows programming so the following could be a very
Wilson> simple question.

Wilson> I am writing a daemon-type windows application so when it is
Wilson> invoked I just want to see an icon on the desktop. When the user
Wilson> double clicks it or select Restore, it should not expand into a
Wilson> full window. How can I do it?

I do not know if you are using  a Class library or the straight Windows
SDK. If you are using the SDK then to run the program iconsised you
need to call ShowWindow(hWnd, SW_SHOWMINIMIZED) in the WinMain after
you have created the main window and this is normally followed by a call
to UpdateWindow(hWnd);

To stop the icon being opened you need to process the WM_QUERYOPEN
message in your main window function and return 0.

I hope this helps.

I did try to mail this at first but I got an unknown user error.






--
Jim Thomas, EDS,Wavendon,Wavendon Tower,Milton Keynes,MK17 8LX,UK
jim@edscom.demon.co.uk   Tel:  +44 1908 284522
Opinions expressed are my own, and are not necessarily those of my employer.
</PRE>


<HR><A NAME=WINAPI_LIMIT_WINDOW_SIZE>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br> 
<H4>Subject: Limit the size of a Window</H4><PRE>
>       I would like to use WM_GETMINMAX  to limit the size of a window.
>       I know that I can do that because I used to do it back in France, 
>       but I am know working in Thailand where I don't have my code anymore.
>
>       Could you please send me via e-mail the code I need for that !!

I don't have a code example on me, but here is what you need to do:

    1) Process the WM_GETMINMAXINFO message in your window procedure
    2) if I remember right, lParam is the pointer to a GetMinMaxInfo
       (or something similar, check the docs under WM_GETMINMAXINFO)
       struct.  Use that pointer to modify the entries in the struct
       to the size that you want to limit your window to.
    3)  Pass the message on to DefWindowProc



-- 
-----------------------------------------------------------
Daniel G. Hyams
email:  dhyams@eng.clemson.edu
WWW:    http://www.eng.clemson.edu/~dhyams/
phone:  (803) 639-4722
-----------------------------------------------------------

</PRE>


<HR><A NAME=WINAPI_BACKGROUND_BITMAP>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br> 
<H4>Subject: How to set Window BackGroup Bitmap?</H4><PRE>
In article <3timgs$bqh@senior.nectec.or.th> arnaud@mozart.inet.co.th (Arnaud Ventura) writes:
>       Hi ,
>       I am working with Borland C 4  doing a very simple program with 
>       a single Window nd I would like to get a BMP in the background.
>
>       I would like to do it with GetWindowClass() but this function is 
>       not called. Any solution ?
>       Arnaud.
>
>       PS: Reply via e-mail would be great !!!

        Public responses to public questions are even better!!! :)

        Set WNDCLASS.hbrBackground=NULL when you RegisterClass().
        Respond to WM_ERASEBKGND and BitBlt() your bitmap.
-- 
John A. Grant                                           jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa

<HR>
In article <3ttan3$2lq@senior.nectec.or.th> arnaud@mozart.inet.co.th (Arnaud Ventura) writes:
>jagrant@emr1.emr.ca (John Grant) wrote:
>
>>In article <3timgs$bqh@senior.nectec.or.th> arnaud@mozart.inet.co.th (Arnaud Ventura) writes:
>>>     Hi ,
>>>     I am working with Borland C 4  doing a very simple program with 
>>>     a single Window nd I would like to get a BMP in the background.
>>>
>>>     I would like to do it with GetWindowClass() but this function is 
>>>     not called. Any solution ?
>>>     Arnaud.
>>>
>>>     PS: Reply via e-mail would be great !!!
>
>>      Public responses to public questions are even better!!! :)
>
>>      Set WNDCLASS.hbrBackground=NULL when you RegisterClass().
>>      Respond to WM_ERASEBKGND and BitBlt() your bitmap.
>
>
>       Always the same kind of Problems but how can you do to have your 
>       BITMAP repeated on the whole background ???

        Just BitBlt() it many times to the screen, with a different (x,y)
        for each one.  Try it and see. Enough questions.  Start writing
        20 lines of code and try it and see what happens.
-- 
John A. Grant                                           jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
<HR>
I would create a brush with the bitmap you want to display as the background
and then use that brush as the hbrBackground of your WNDCLASS.

Example:

HBITMAP hBitmap;
HBRUSH  hBrush

//Load bitmap from a resource.
hBitmap = LoadBitmap (hInstance, IDB_YOURBACKGROUNDBITMAP);
hBrush = CreatePatternBrush (hBitmap);

//When initializing your window class (prior to registering it).
wndclass.hbrBackground = hBrush

//Delete objects
DeleteObject(hBrush);
DeleteObject(hBitmap);



This repeatedly paints the background with the bitmap you specify.
Hope this helps, it has worked for me in the past.

</PRE>


<HR><A NAME=WINAPI_LF_UNICON_MSG>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br> 
<H4>Subject: What message to what for uniconize a window?</H4><PRE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -