荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: tang (独孤九剑), 信区: Program
标  题: MSVC MailList
发信站: 深大荔园晨风站 (Wed Apr  8 00:27:58 1998), 转信

There are 11 messages totalling 541 lines in this issue.

        Topics of the day:

        1. How To Start Your Web Browser?
        2. How to find a directory is exit ?
        3. ActiveX Container support
        4. Help : How to get the result of the child process ?
        5. VSS, Help
        6. Windows API Messages
        7. Retaining keyboard focus. (2)
        8. TrackPopupMenuEx
        9. Finding the lcalized name of languages
        10. MenuItem Check Mark


--------------------------------------------------------------------------
        The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
        international's LISTSERV(R) software. For subscription info and
archives,
        see http://peach.ease.lsoft.com/archives/msvc.html . For LISTSERV sales
        information, see http://www.lsoft.com or write to SALES@LSOFT.COM.

        ----------------------------------------------------------------------

        Date: Sun, 5 Apr 1998 21:02:04 -0700
        From: Mark Regal <mregal@EARTHLINK.NET>
        Subject: Re: How To Start Your Web Browser?

        Thanks. Mats, another member of this list server, sent me a URL that I =
        borrowed a code snippet from. The code that I borrowed was from the
Code =
        Guru's web site, (thanks Code Guru), and it went something like this:


        HINSTANCE CHyperLink::GotoURL(LPCTSTR url, int showcmd)
        {
        TCHAR key[MAX_PATH + MAX_PATH];

        // First try ShellExecute()
        HINSTANCE result =3D ShellExecute(NULL, _T("open"), url, NULL,NULL, =
        showcmd);

        // If it failed, get the .htm regkey and lookup the program
        if ((UINT)result <=3D HINSTANCE_ERROR) {

        if (GetRegKey(HKEY_CLASSES_ROOT, _T(".htm"), key) =3D=3D =
        ERROR_SUCCESS) {
        lstrcat(key, _T("\\shell\\open\\command"));

        if (GetRegKey(HKEY_CLASSES_ROOT,key,key) =3D=3D =
        ERROR_SUCCESS) {
        TCHAR *pos;
        pos =3D _tcsstr(key, _T("\"%1\""));
        if (pos =3D=3D NULL) { // No quotes =
        found
        pos =3D strstr(key, _T("%1")); // Check for =
        if (pos =3D=3D NULL) // No =
        parameter at all...
        pos =3D key+lstrlen(key)-1;
        else
        *pos =3D '\0'; // Remove the =
        parameter
        }
        else
        *pos =3D '\0'; // Remove the =
        parameter

        lstrcat(pos, _T(" "));
        lstrcat(pos, url);
        result =3D (HINSTANCE) WinExec(key,showcmd);
        }
        }
        }

        return result;
        }


        I hope the formatting of this message is decent. I not certain as to
the =
        proper settings for a compliant universal email just yet. A friend uses
=
        Pegasus email and she says she can never read Microsoft Outlook's =
        default settings. I haven't tried any new settings yet so I do hope
this =
        works. Anyway, thanks for the suggestion.

        PS, I must have 2 dozen books on C++ and I can't seem to find the =
        ShellExecute command in any of them! Isn't it ironic?


        Mark Regal
        mregal@earthlink.net
        Surfers Rule!




        -----Original Message-----
        From: Irina Koulinitch [SMTP:IKoulinitch@vet.com.au]
        Sent: Sunday, April 05, 1998 4:41 PM
        To: mregal@earthlink.net
        Cc: MSVC@PEACH.EASE.LSOFT.COM
        Subject: Re: How To Start Your Web Browser?

        > How does one go about starting a web browser from a MSVC application.
=
        I guess no one could really know > which browser a person had on his or
=
        her system, right? Any ideas? Thanks.

        If you want to open a browser with a parcticular page in it -
        you can use ShellExecute() function with the http address as a parameter
        (have a look in help for the usage of that function).

        Else you can find the path of the default browser in the registry at
        HKEY_LOCAL_MACHINE\Software\Classes\htmlfile\shell\open\command

        Regards,
        Irina.

        ------------------------------

        Date: Mon, 6 Apr 1998 11:05:00 +0200
        From: Arkadiusz Malesa <malesa@SPONSOR.COM.PL>
        Subject: Re: How to find a directory is exit ?

        Hi,

        It is a good way to determine it:


        DWORD dwAttrs = GetFileAttributes(sDir);
        if ( dwAttrs == 0xffffffff )
        {
        if(GetLastError() != ERROR_FILE_NOT_FOUND)
        TRACE("GetFileAttributes(%s) returns error code !", Dir);
        return (FALSE); // Not exists
        }
        if ( (dwAttrs & FILE_ATTRIBUTE_DIRECTORY) != 0 )
        return (TRUE); // Directory exists

        return(FALSE); // Not exists (only file with the same name exists)

        Arek


        At 22:38 98-04-03 +0800, you wrote:
        >Hi,
        >
        >Ni hao.
        >
        >You may just try to create a directory. you can get the error when it
is
        >failured.
        >the most case of error is a directory is already exist.
        >
        >Liuwei
        >from Beijing
        >
        >At 08:09 PM 98/04/03 +0800, you wrote:
        >>Hi :
        >>
        >> I know that in vc5 there are functions to "create , move , delete"
        >directory . But is there a function to determine a directory is exit ?
        >Because I want to use it before create a directory .
        >>
        >> thanks
        >>
        >> Chuang Huang
        >
        >
--------------------------------------------------------------------------
        >The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
        >international's LISTSERV(R) software. For subscription info and
archives,
        >see http://peach.ease.lsoft.com/archives/msvc.html . For LISTSERV sales
        >information, see http://www.lsoft.com or write to SALES@LSOFT.COM.
        >

        ------------------------------

        Date: Mon, 6 Apr 1998 14:19:23 +0200
        From: Ruben Santos Martinez de Laguna <ruben@MEDITEL-IM.COM>
        Subject: ActiveX Container support

        Hi,
        I need to write an app with activex document support. I was working with
        vc4.2, but now I'm working with vc5.0. I thought vc5.0 would have this
        functionality but there is only support to activex servers.
        Is there any source of information, samples, etc.

        Any idea?


        Thanks in advance

        Ruben

        ------------------------------

        Date: Mon, 6 Apr 1998 20:36:54 +0800
        From: Chuan Huang <chhuang@BLUE.HUST.EDU.CN>
        Subject: Help : How to get the result of the child process ?

        This is a multi-part message in MIME format.

        ------=_NextPart_000_000C_01BD619B.BC573960
        Content-Type: text/plain;
        charset="gb2312"
        Content-Transfer-Encoding: quoted-printable

        Hello , everybody:
        I meet such questions :
        =20
        How can I get the result of child Proess ? When I run =
        "CreateProcess(NULL , "ping.exe 202.0.20.130 " ....)" There will popup =
        an ms_dos windows and show the result in it. But I want the ms_dos =
        windows not be popup and the result be writed to the file or string =
        defined in the parent process then I could use it . How can I do it?

        And how can I run an dos command such as "dir" use CreateProcess() =
        . It seemed not be "CreateProcess(NULL , "command.com dir *.txt" ....)"
=
        or "CreateProcess(NULL , "dir *.txt" ....) .

        Thanks for any sugesstion !

        Chuan Huang

        ------=_NextPart_000_000C_01BD619B.BC573960
        Content-Type: text/html;
        charset="gb2312"
        Content-Transfer-Encoding: quoted-printable

        <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
        <HTML>
        <HEAD>

        <META content=3Dtext/html;charset=3Dgb2312 http-equiv=3DContent-Type>
        <META content=3D'"MSHTML 4.71.1712.3"' name=3DGENERATOR>
        </HEAD>
        <BODY bgColor=3D#ffffff>
        <DIV><FONT color=3D#000000 size=3D2>Hello , everybody:</FONT></DIV>
        <DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; I meet
such =
        questions=20
        :</FONT></DIV>
        <DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; =
        </FONT></DIV>
        <DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp;&nbsp; How can I get
the =
        result of=20
        child Proess ? When I run &quot;CreateProcess(NULL , &quot;ping.exe =
        202.0.20.130=20
        &quot; ....)&quot; There will popup an ms_dos windows and show the =
        result in it.=20
        But I want the ms_dos windows not be popup and the result be writed to =
        the file=20
        or string defined in the parent process then I could use it . How can I
=
        do=20
        it?</FONT></DIV>
        <DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
        <DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; And how
can =
        I run an=20
        dos command such as &quot;dir&quot; use CreateProcess() . It seemed not
=
        be=20
        &quot;CreateProcess(NULL , &quot;command.com dir *.txt&quot; ....)&quot;
 =
        or=20
        &quot;CreateProcess(NULL , &quot;dir *.txt&quot; ....) .</FONT></DIV>
        <DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
        <DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; Thanks for
=
        any=20
        sugesstion !</FONT></DIV>
        <DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
        <DIV><FONT color=3D#000000=20
        size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
        Chuan=20
        Huang</FONT></DIV></BODY></HTML>

        ------=_NextPart_000_000C_01BD619B.BC573960--

        ------------------------------

        Date: Mon, 6 Apr 1998 08:15:08 -0500
        From: Jeff Nygren <Jeff_Nygren@DATACARD.COM>
        Subject: Re: VSS, Help

        Dave,

        Thanks for replying. I knew I left out a few details in my original
message.
        I'm running VSS version 5.0 on Win95. Since you mentioned "each pane",
I'm
        guessing you are using the format 'Visual'. (Two, side-by-side panes.)
My
        problem is in the format 'SourceSafe'. (Single pane, lines marked
INS(erted),
        DEL(eted), etc.) These difference formats may only be available in VSS
version
        5.0 and above. (I've never used earlier versions.) I can look at half a
pane
        of 'white space' to the right of the truncated lines, so I don't think a
        horizontal scroll bar would help, even if there was one in this view.

        Does anyone have any other ideas?

        Jeff Nygren

        (P.S. Dave, I DO appreciate your reply, even if it wasn't the solution
to my
        problem.)


        ______________________________ Reply Separator
_________________________________
        Subject: Re: VSS, Help
        Author: Dave Thompson <davidth@WRQ.COM> at Internet
        Date: 4/3/98 8:15 AM


        When I look at differences in files, I have two scroll bars at the
bottom
        of each pane and can move left/right. I am on NT 4.0. I am pretty sure
it
        works on Win95. Do not know about nt 3.51. I have heard rumors about
        horizontal scroll bars not working under some condition. Are you running
        service pack 3 if NT 4.0?

        -----Original Message-----
        From: Jeff Nygren [SMTP:Jeff_Nygren@DATACARD.COM]
        Sent: Friday, April 03, 1998 6:48 AM
        To: MSVC@PEACH.EASE.LSOFT.COM
        Subject: VSS, Help

        I apologize for this being a little off-topic (only a little).

        Can any of you who are using Visual SourceSafe for you source control
        system,
        help me with this problem? I select a project and click "File/Project
        Difference". Then I select any of the 'Changed' files and click the
        "File/Project Difference" button in the "Project Difference" window. In
the
        "Difference Options" dialog, I have the format "SourceSafe" selected
and I
        click OK. The "Differences for <file>" that is displayed is truncated at
        around the 80th column! I can't find any way to get SourceSafe to
display
        the
        full line! This is pretty worthless when the changes are beyond the
column
        where the display or printout is truncated.

        If any of you can tell me how to get around this problem, I would
greatly
        appreciate it. Thanks.

        Jeff Nygren

        ------------------------------

        Date: Mon, 6 Apr 1998 08:27:28 -0500
        From: Timothy Dixon <tdixon@PHDINC.COM>
        Subject: Windows API Messages

        Hi all!

        For various reasons (largely, but not entirely related to legacy code),
my
        company codes the API directly, without using MFC. I'm having trouble
        getting a handle on the Windows API messages (no pun intended). I found
        what appears to be a comprehensive list of messages known to the system,
        but it's too big to be managable. Does anybody have a list of what the
        prefixes on the messages stand for? That would go a long way toward
making
        that list useful. For instance, WM_CLOSE has a WM_ prefix which I know
        stands for Windows Message. Similary, WN_ is Windows Notify.

        Any ideas? I can't hit the web from my desk just now, so a resource
        e-mailed to me would be great, but don't shy away from sending a url if
        that's all you've got; I'll just have to surf to it at home.

        TIA!

        Tim Dixon
        Software Engineer
        PHD, Inc.

        ------------------------------

        Date: Mon, 6 Apr 1998 09:02:49 -0500
        From: Jeff Nygren <Jeff_Nygren@DATACARD.COM>
        Subject: Re: Retaining keyboard focus.

        How about a system-modal dialog? (Does such a thing still exist in the
32-bit
        world?)


        ______________________________ Reply Separator
_________________________________
        Subject: Re: Retaining keyboard focus.
        Author: Tim Pollock <tpollock@INLINK.COM> at Internet
        Date: 4/5/98 9:48 AM


        Thanks for the suggestion,

        I am using a modal dialog box, specifying it with DS_MODALFRAME. I tried
        using SetCapture in the WM_INITDIALOG section of the dialog box
procedure
        and ReleaseCapture before EndDialog, but with no luck. I can still click
        on another window and windows transfers focus there.

        Thanks,

        Tim

        ------------------------------

        Date: Mon, 6 Apr 1998 09:34:35 -0500
        From: Tim Pollock <tpollock@INLINK.COM>
        Subject: Re: Retaining keyboard focus.

        SDK documentation states that: "Dialog boxes with the DS_SYSMODAL style
        receive the WS_EX_TOPMOST window style but no other special properties
or
        styles; this means the user still has access to other windows on the
        desktop even though a DS_SYSMODAL dialog box may be displayed."

        I'll try it, but it doesn't seem promising.
        Thanks,
        Tim


        ----------
        > From: Jeff Nygren <Jeff_Nygren@DATACARD.COM>
        > To: MSVC@PEACH.EASE.LSOFT.COM
        > Subject: Re: Retaining keyboard focus.
        > Date: Monday, April 06, 1998 9:02 AM
        >
        > How about a system-modal dialog? (Does such a thing still exist in the
        32-bit
        > world?)
        >
        >
        > ______________________________ Reply Separator
        _________________________________
        > Subject: Re: Retaining keyboard focus.
        > Author: Tim Pollock <tpollock@INLINK.COM> at Internet
        > Date: 4/5/98 9:48 AM
        >
        >
        > Thanks for the suggestion,
        >
        > I am using a modal dialog box, specifying it with DS_MODALFRAME. I
tried
        > using SetCapture in the WM_INITDIALOG section of the dialog box
procedure
        > and ReleaseCapture before EndDialog, but with no luck. I can still
click
        > on another window and windows transfers focus there.
        >
        > Thanks,
        >
        > Tim
        >
        >

--------------------------------------------------------------------------
        > The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
        > international's LISTSERV(R) software. For subscription info and
        archives,
        > see http://peach.ease.lsoft.com/archives/msvc.html . For LISTSERV
sales
        > information, see http://www.lsoft.com or write to SALES@LSOFT.COM.

        ------------------------------

        Date: Tue, 7 Apr 1998 01:51:07 +0530
        From: Sumit Rana <sumitran@GIASDLA.VSNL.NET.IN>
        Subject: TrackPopupMenuEx

        Environment: VC++ 4.1 / Win95

        hi.
        i have a new problem.
        when i load a menu from a menu resource and then try to call
        ::TrackPopupMenuEx()
        or CMenu::TrackPopupMenu(), either way windows draws a small rectangle
        and only
        after i move on top of this tiny rectangle, does the menu pop out? What
        is happening
        here, any clues. On the other hand, if i do not load the menu from menu
        resource,
        but instead Create the menu on the fly using CreatePopupMenu() /
        AppendMenu(),
        TrackPopupMenuEx() shows the menu fine without any little rectangle.
        What am
        missing?

        Another problem which seems to perplex me is like this. I have the new
        user.exe /
        user32.dll files from microsoft which have certain GUI enhancements of
        Memphis
        like gradient CaptionBars and animated sliding menus. Again, my problem
        concerns
        menus. When i write a menu in a MFC Program, the menu doesn't slide like
        the ones
        in memphis but come straight up like Win95. But if i write a standard
        WinAPI32
        application, the same TrackPopupMenuEx() makes the menu slide. I am
        really confused
        as to what is happenening. Has Microsoft hardcoded the menu code in MFC.
        That
        seems very unlikely.

        The third problem concerns menus with a bitmap logo on the side of a
        menu like Norton
        Utilities. Can anyone throw light on how to do this. The mene looks
        something like this :-

        *********************************
        | This | Cut |
        | Area | Copy |
        | contains | Paste |
        | a |----------------|
        | Bitmap | Exit |
        *********************************

        TIA
        Sumit

        ------------------------------

        Date: Tue, 7 Apr 1998 01:58:18 +0100
        From: =?ISO-8859-1?Q?Mats M錸hav ?= <mats.manhav@SWIPNET.SE>
        Subject: Finding the lcalized name of languages

        Environment: MSVC 5.0 (sp3) Win NT 4.0 (sp3)
        Hello,

        I need to find the localized string representation for different
        languages. Is this possible.
        E.g I need to find the name that Windows will use for Swedish, in the
        current locale. I.e Svenska on a swedish windows and Swedish on an
        english.
        I would like to call a function with the language ID as parameter and
        get the language name back.

        Best regards,
        Mats
        mailto:mats.manhav@swipnet.se

        ------------------------------

        Date: Mon, 6 Apr 1998 17:09:08 -0700
        From: Doug Graham <dgraham@XYPOINT.COM>
        Subject: MenuItem Check Mark

        I have a popup menu that I can not change the menuItem check mark on. I
        have created an UPDATE_COMMAN_UI call back for each of the four items in
        my menu. I do a pCmdUI->SetCheck(1); in each callback. I can set a
        breakpoint in each callback and each does get called. But I can not get
        a check mark to show up on the popup.

        Any suggestions?

        TIA, Doug

        ------------------------------

        End of MSVC Digest - 5 Apr 1998 to 6 Apr 1998 (#1998-96)

--
        There are these few times I feel lonely for you.
        But I know this shade of blue will soon pass through!
        I must be strong without you by my side!
        I can see forever you are my light.

※ 来源:.深大荔园晨风站 bbs.szu.edu.cn.[FROM: 202.192.140.130]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店