Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 66463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:06:26+00:00 2026-05-10T19:06:26+00:00

I am trying to detect which web in sharepoint that the user is looking

  • 0

I am trying to detect which web in sharepoint that the user is looking at right now. One approach could be to read the URls from the browser and try to compare them to a reference URL to the sharepoint solution. I have not yet been able to locate any solution that works in both IE and Firefox.

The idea is to write a small C# app that will harvest the URLs and do the comparing.

TIA

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:06:27+00:00Added an answer on May 10, 2026 at 7:06 pm

    It is possible to do this in a very hacky and prone to breakage way using the Win32 API function FindWindow.

    The following C++ example that finds a running instance of the windows Calculator and gets the value of the edit field in it. You should be able to do something similar in C#. Disclaimer: I haven’t actually checked to make sure this code compiles, sorry. 🙂

    float GetCalcResult(void) {     float retval = 0.0f;      HWND calc= FindWindow('SciCalc', 'Calculator');     if (calc == NULL) {         calc= FindWindow('Calc', 'Calculator');     }     if (calc == NULL) {         MessageBox(NULL, 'calculator not found', 'Error', MB_OK);         return 0.0f;     }     HWND calcEdit = FindWindowEx(calc, 0, 'Edit', NULL);     if (calcEdit == NULL) {         MessageBox(NULL, 'error finding calc edit box', 'Error', MB_OK);         return 0.0f;     }      long len = SendMessage(calcEdit, WM_GETTEXTLENGTH, 0, 0) + 1;     char* temp = (char*) malloc(len);     SendMessage(calcEdit, WM_GETTEXT, len, (LPARAM) temp);     retval = atof(temp);     free(temp);      return retval; } 

    In order to find out the right parameters to use in FindWindow and FindWindowEx, use the Visual Studio tool Spy++ to inspect a running instance of your browser window. Sorry, I don’t have a code sample for web browsers on-hand, but it should be possible. Note that your solution will be Windows OS specific, and also changes to the UI architecture in future versions of the web browsers could cause your solution to stop working.

    Using this method to lift the URL right out of the address bar obviously only works for the current tab. I can’t see how this would work for all tabs unless you did something really tricky like simulating user input to cycle through the tabs. That would be very intrusive and a user could easily mess up your application by interrupting it with input of their own, but it might work if you’re writing something that runs unattended, like an automated test script. If that is the case, you may want to look into other tools like AutoIt.

    This advice is all paraphrased from a blog post I once wrote. Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 68k
  • Answers 68k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You are missing the parentheses of the method call: ToString()… May 11, 2026 at 12:23 pm
  • added an answer From CLDR's supplemental data (release 36, October 2019): <firstDay day='mon'… May 11, 2026 at 12:23 pm
  • added an answer In order to test Silverlight, you will need to create… May 11, 2026 at 12:23 pm

Related Questions

I am trying to set a javascript date so that it can be submitted
I am trying to grab the capital letters of a couple of words and
StackOverflow, you're my only hope! I am unfortunate enough to have inherited an ASP.NET
I have an XML feed (which I don't control) and I am trying to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.