Solved

Win95 Network (Workgroups?) routines?

Posted on 1998-07-19
4
268 Views
Last Modified: 2010-04-04
How do I use the Windows Network? I mean the Win95 workgroups network. I want to access other
computers. How do I do it?
How do I enter the password for shared folders? Will it be possible to write a program that 'hacks' this
password? It seems possible to me...
0
Comment
Question by:ShadowHawk071998
  • 2
  • 2
4 Comments
 

Accepted Solution

by:
lorenk earned 90 total points
ID: 1358243
Do you mean "how do you programmatically access other machines on the Windows Network?"  If so, then the answer is with the Shell API found in Shell32.dll.

The functions you want are:

SHGetDesktopFolder to get an instance of the desktop
then:

SHGetSpecialFolderLocation to get the instance of the network neighborhood.

-Loren
0
 

Author Comment

by:ShadowHawk071998
ID: 1358244
Okay.
Anyone has more 'concrete' suggestions? So I won't have to hack it down all
myself?
How do I ACTUALLY use these in Delphi? Anyone can give a short example?
0
 

Expert Comment

by:lorenk
ID: 1358245
Here's my code in C++Builder.  The conversion to Delphi should be trivial, but I can do it for you if you like

    LPSHELLFOLDER lpsf = NULL, lpsf2 = NULL;
    LPITEMIDLIST pidl, lpi = NULL;
    LPENUMIDLIST lpe;
 
    SHGetDesktopFolder(&lpsf);

    SHGetSpecialFolderLocation(Handle, CSIDL_NETWORK, &lpi);
    lpsf->BindToObject((LPCITEMIDLIST)lpi, NULL, IID_IShellFolder, (LPVOID *)&lpsf2);
    lpsf2->EnumObjects(Handle, 32 | 64 | 128, &lpe);
    while (S_OK == lpe->Next(1, &lpi, &ulFetched))
    {
        char lpName[MAX_PATH];
        memset(lpName, 0, 256);
        STRRET StrName;
        lpsf->GetDisplayNameOf(lpi, dwFlags, &StrName);
        switch(StrName.uType)
        {
            case STRRET_WSTR:
                WideCharToMultiByte(CP_ACP,0,StrName.pOleStr,-1,lpName,
                    sizeof(lpName),NULL,NULL);
                break;
            case STRRET_OFFSET:
                strcpy(lpName, (LPSTR)lpi+StrName.uOffset);
                break;
            case STRRET_CSTR:
                strcpy(lpName, (LPSTR)StrName.cStr);
                break;
        }

     }

Enjoy!
0
 

Author Comment

by:ShadowHawk071998
ID: 1358246
That is much better :)
I would hugely appriciate having you 'translate' it to delphi if you have the time. Although I 'know' C++ I haven't used it in years. I should start soon, but I'd prefer a pascal example...
Thanks again!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now